home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / FireWire 1.1 DDK DR1 / Interfaces / FireWire.h < prev    next >
Encoding:
Text File  |  1997-06-10  |  93.6 KB  |  3,013 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FireWire.h
  3.  
  4.     Contains:    Definitions and interfaces for FireWire driver family.
  5.  
  6.     Written by:    Erik Staats
  7.  
  8.     Copyright:    © 1996-1997 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.      <FW102>     3/14/97    ES        Changed error code values to one's we've been allocated.
  13.      <FW101>      3/3/97    ES        Added DCLTimeStamp.
  14.      <FW100>     2/20/97    ES        Rearranged FWClientAsynchRequestParams, removed buffer, and
  15.                                     added receiveBuffer, transmitBuffer, and responseCode.
  16.       <FW99>     2/14/97    ES        Added FWIMFinalize and FWIMPollInterrupts to FWIM plug in
  17.                                     dispatch table.
  18.       <FW98>     2/14/97    ES        Moved transfer buffer packet size into the transfer buffer DCL
  19.                                     and removed the set packet size DCL.
  20.       <FW97>     2/14/97    ES        Added procedure prototype for FWModifyDCLList and added some
  21.                                     defs for DCL opcode flags.
  22.       <FW96>      2/6/97    ES        Removed some private fields from FWClientInterfaceParams.
  23.       <FW95>      2/6/97    ES        Removed some private fields from FWIMCommandParams record. Added
  24.                                     procedure prototypes for registering protocol drivers.
  25.       <FW94>      2/4/97    ES        Added private and initial unit address space allocation options
  26.                                     to FWAllocateAddressSpace. Added defs for initial memory,
  27.                                     private, and initial unit address spaces. Added support for
  28.                                     offset entries to FWCSRROMCreateEntry.
  29.       <FW93>     1/27/97    ES        Changed protocol driver file type to 'ndrv'. Fixes bug #1621930.
  30.       <FW92>     1/16/97    ES        Changed CSR ROM search key bit constant names. Added procedure
  31.                                     prototype for FWCSRROMDisposeEntry.
  32.       <FW91>      1/9/97    ES        Added includes so this file can compile by itself.
  33.       <FW90>      1/8/97    ES        Changed defs for kInvalidCSRROMEntryType and
  34.                                     kImmediateCSRROMEntryType. Added generation and sourceID fields
  35.                                     to FWClientAsynchRequestParams. Added procedure prototypes for
  36.                                     FWGetFWDeviceIDFromFWReferenceID, FWFindFWDeviceFromNodeID, and
  37.                                     FWGetUnitCSRROMEntryID.
  38.       <FW89>      1/1/97    ES        Added FWUpdateDCLList. Changed the DCL notification interface.
  39.                                     Changed DCL event defs to kFWDCL<Event>Event.
  40.       <FW88>    12/27/96    ES        Added a bunch of procedure prototypes.
  41.       <FW87>    12/27/96    ES        Changed a bunch of "FWDriver"s to "FWClient"s and added support
  42.                                     for protocol drivers, clients, and units.
  43.       <FW86>    12/26/96    ES        Added support for DCL program stop and release procs.
  44.       <FW85>    12/16/96    ES        Changed to work with new read/write/lock request/complete
  45.                                     processing mechanism.
  46.       <FW84>    12/26/96    ES        Consolidated some parameters in asynch FWIM commands and
  47.                                     processing.
  48.       <FW83>    12/22/96    ES        Changed IsochPortAction to IsochPortControl.
  49.       <FW82>    12/12/96    ES        Took transmit buffer out of FWIMProcessAsynchParams record.
  50.       <FW81>    12/11/96    ES        Removed some fields from FWIMProcessAsynchParams. Changed
  51.                                     FWIMProcess routines to return OSStatus.
  52.       <FW80>    12/10/96    ES        Added defs for isochronous channel force stop notification.
  53.       <FW79>     12/6/96    ES        Changed FWIMInstallParams to FWIMInitializeParams and changed
  54.                                     some of the fields in FWIMInitializeParams.
  55.                                     FWIMAsynchCommandParams were changed to supply the split
  56.                                     transaction timeout.
  57.       <FW78>     12/6/96    ES        Added FWClippedSubtract.
  58.       <FW77>     12/3/96    ES        Added kFWFixedAddress flag to FWAllocateAddressSpace.
  59.       <FW76>    11/27/96    ES        Added retryExceededErr.
  60.       <FW75>    11/26/96    ES        Added procedure prototype for FWStartDCLProgram.
  61.       <FW74>    11/11/96    ES        Added GetUniqueID FWIM command and FWDeallocateAddressSpace.
  62.       <FW73>     11/5/96    ES        Added stuff for FireWire deferred tasks.
  63.       <FW72>    10/18/96    ES        Added kDCLSendBufferOp and kDCLSetPacketSizeOp. Changed the
  64.                                     definition of DCL compiler notification procs. Added a number of
  65.                                     DCL procedure prototypes.
  66.       <FW71>    10/16/96    ES        Added stuff for bus management notification. Also, added
  67.                                     disconnectedErr.
  68.       <FW70>     10/4/96    ES        Added procedure prototype for FWCallDCLCallProc.
  69.       <FW69>     10/4/96    ES        Replaced DCLSetPacketAttributes command with DCLSetTagSyncBits
  70.                                     command. Added DCLSetPacketWithHeaderStart command.
  71.       <FW68>     10/3/96    ES        Added FWIMPluginDispatchTable stuff.
  72.       <FW67>     10/3/96    ES        Removed GetTopologyMap FWIM command. Made FWGetTopologyMap
  73.                                     immediate. Added FWProcessSelfIDs.
  74.       <FW66>     9/27/96    ES        Added procedure prototypes for routines to set and get driver
  75.                                     interface procs and removed driver interface table from
  76.                                     FWRegisterDriver.
  77.       <FW65>     9/26/96    ES        Added kFWAsynchFailOnBusReset.
  78.       <FW64>     9/26/96    ES        Added separateBusErr.
  79.       <FW63>     9/25/96    ES        Added kFWAsynchAbsoluteAddress.
  80.       <FW62>     9/25/96    ES        Added FWIM asynchronous transaction response commands. Changed
  81.                                     FWIMProcessAsynchParams record.
  82.       <FW61>     9/20/96    ES        Added kFWAsynchDisableAddressIncrement to allow disabling of
  83.                                     automatic address incrementing on asynchronous transfers.
  84.       <FW60>     9/16/96    ES        Changed FWIM and FireWire driver interfaces to return command
  85.                                     acceptance.
  86.       <FW59>     9/16/96    ES        Added response code field to FWIMProcessAsynchRequestParams.
  87.                                     Took out some unused constants and data structures.
  88.       <FW58>     9/16/96    ES        Fixed defs for kFWIsochTCode and kFWIsochTag.
  89.       <FW57>     9/11/96    ES        Changed maxRetries for FCP commands to be UInt32 instead of
  90.                                     SInt32.
  91.       <FW56>     9/11/96    ES        Added kFWMaxNodeHops, kFWTopologyMapMaxSelfIDs, and FWSpeedMap
  92.                                     defs. Added speed parameter to FWIMAsynchCommandParams.
  93.       <FW55>      9/5/96    ES        Added fwDriverAsynchRequestParams to FWIMProcessAsynchParams
  94.                                     record and changed completionProcData in FWIMProcessParams
  95.                                     record to a UInt32.
  96.       <FW54>      9/4/96    ES        Added procedure prototype for FWDeallocateIsochronousChannelID.
  97.       <FW53>      9/3/96    ES        Added driver reset notification.
  98.       <FW52>      9/3/96    ES        Added kFWIMSendLinkOnPacket.
  99.       <FW51>     8/30/96    ES        Added a bunch of stuff for isochronous resource management.
  100.       <FW50>     8/29/96    ES        Added set and clear contender bit FWIM commands.
  101.       <FW49>     8/29/96    ES        Changed FWRegisterDriver to take driver interface proc table.
  102.       <FW48>     8/28/96    ES        Added procedure prototypes for FWProcessLockRequest. Added def
  103.                                     for kFWDriverLock. Added extendedTCode to some asynch command
  104.                                     parameter records.
  105.       <FW47>     8/28/96    ES        Added kFWAsynchOverrideMaxPayload to asynch transfer flags.
  106.       <FW46>     8/26/96    ES        Put back kInvalidFWGenerationNumber.
  107.       <FW45>     8/26/96    ES        Changed to new command object interface.
  108.       <FW44>     8/26/96    ES        Added local node ID to FWIMGetTopologyMapParams record, added
  109.                                     FWGetLocalFWReferenceIDFromFWReferenceID, and changed some
  110.                                     constant names.
  111.       <FW43>     8/16/96    ES        Added immediate modes. Changed FWAllocateIsochPort to take
  112.                                     FWAllocateIsochPortParams.
  113.       <FW42>     8/15/96    ES        Added defs for queueing for FW driver commands. Added procedure
  114.                                     prototypes for dynamically changing destination of DCL jump
  115.                                     commands. Added defs for making isoch channel and port routines
  116.                                     asynchronous.
  117.       <FW41>      8/8/96    ES        Added FWTranslateDCLProgram.
  118.       <FW40>      8/2/96    ES        Replaced IsochBufferChains with DCLPrograms.
  119.       <FW39>     7/31/96    ES        Changed to implement new isochronous buffering architecture.
  120.       <FW38>      7/8/96    ES        Added support for isochronous transmission. Added FWClippedAdd.
  121.                                     Added IRM allocation option to FWAllocateIsochronousChannelID.
  122.       <FW37>     6/24/96    ES        Added FWCompareAndSwap.
  123.       <FW36>     6/20/96    ES        Made this look more like a .i generated interface.
  124.       <FW35>     6/14/96    ES        Added FWUnregisterDriver.
  125.       <FW34>     5/31/96    ES        Took out expert notification stuff and added some virtual device
  126.                                     defs.
  127.       <FW33>     4/29/96    ES        Cleaned up FWCSRROMCreateEntryID procedure prototype.
  128.       <FW32>     4/17/96    ES        Changed and added some procedure prototypes.
  129.       <FW31>     4/15/96    ES        Got rid of stuff for FWDriverInstall and added stuff for
  130.                                     FWRegisterDriver.
  131.       <FW30>      4/5/96    ES        Added a bunch of CSRROM service procedure prototypes.
  132.       <FW29>     3/29/96    ES        Moved some of the virtual device stuff here from the private
  133.                                     header.
  134.       <FW28>     3/25/96    ES        Added support for asynch request packet handling by drivers.
  135.       <FW27>     3/12/96    ES        Added FWVDeviceID.
  136.       <FW26>      3/8/96    ES        Add stuff for creating CSR configuration ROM entries on the
  137.                                     local host.
  138.       <FW25>      3/7/96    ES        Changed stuff with address spaces and FWIM processing requests.
  139.       <FW24>     2/22/96    ES        Added stuff for FWIsochResourceManagerID.
  140.       <FW23>     2/21/96    ES        Added fwimData to IsochChannelBufferStruct, changed fwimData to
  141.                                     a UInt32 in IsochBufferChainStruct, and added isochChannelID to
  142.                                     FWDriverIsochPortParamsStruct.
  143.       <FW22>     2/21/96    ES        Added a bunch of atomic operations.
  144.       <FW21>     2/16/96    ES        Added procedure prototypes for FWAllocateIsochBufferChainID and
  145.                                     FWDeallocateIsochBufferChainID and changed some stuff for
  146.                                     isochronous ports.
  147.       <FW20>      2/9/96    ES        Added stuff for FWGetTopologyMap and for synchronizing the
  148.                                     services queue.
  149.       <FW19>      2/7/96    ES        Added kInvalidNodeID.
  150.       <FW18>      2/7/96    ES        Added FWThresholdAdd and FWThresholdSubtract and a whole bunch
  151.                                     of other stuff for doing lock transactions.
  152.       <FW17>      2/2/96    ES        Added stuff for disabling the FWIM command queue and specifying
  153.                                     the bus generation number in FireWire asynch commands.
  154.       <FW16>      2/1/96    ES        Added kFWIMCommandPriorityFlag, kFWInterfacePriorityFlag, and
  155.                                     busReconfiguredErr.
  156.       <FW15>     1/30/96    ES        Added stuff for doing bus resets.
  157.       <FW14>     1/30/96    ES        Defined kFWRequestWaiting and changed pNextFWInterfaceParams in
  158.                                     FWInterfaceParamsStruct from FWInterfaceParamsPtr * to
  159.                                     FWInterfaceParamsPtr.
  160.       <FW13>     1/26/96    ES        Added FWSetMaxPayloadSize and other maxPayload stuff.
  161.       <FW12>     1/24/96    ES        Added responseHandler and settable timeout to FCP command
  162.                                     params.
  163.       <FW11>     1/18/96    ES        Added function prototypes for task and software interrupt
  164.                                     services. Changed kMaxSelfIDPacketsPerNode to 9.
  165.       <FW10>     1/12/96    ES        Added FWReleaseIsochronousChannel and
  166.                                     FWReleaseLocalIsochronousPort. Changed kFWInvalidFWIMCommandID
  167.                                     to kInvalidFWIMCommandID.
  168.        <FW9>     1/12/96    ES        Added flags to FWIMCommandParams.
  169.        <FW8>     1/11/96    ES        Changed request and interface to command in most of the FWIM
  170.                                     stuff.
  171.        <FW7>     1/11/96    ES        Changed calling parameters for FWCommandIsComplete and changed
  172.                                     to FWIMCommandIsComplete. Added stuff for FWIMCommandIDs.
  173.        <FW6>     1/10/96    ES        Added prototype for FWProcessBusReset.
  174.        <FW5>      1/9/96    ES        Added FWProcessWriteRequest and removed kFWWriteNotify.
  175.        <FW4>      1/9/96    ES        Really got rid of kFWFWIMRequestCompleteNotify.
  176.        <FW3>      1/9/96    ES        Added FWCommandIsComplete. Removed kFWFWIMRequestCompleteNotify.
  177.        <FW2>      1/6/96    ES        Fill in contains and written by fields.
  178.        <FW1>      1/6/96    ES        first checked in
  179.  
  180. */
  181.  
  182. #ifndef __FIREWIRE__
  183. #define __FIREWIRE__
  184.  
  185. #ifndef __TYPES__
  186. #include <Types.h>
  187. #endif
  188.  
  189. #ifndef __DRIVERSERVICES__
  190. #include <DriverServices.h>
  191. #endif
  192.  
  193. #ifdef __cplusplus
  194. extern "C" {
  195. #endif
  196.  
  197. #if PRAGMA_IMPORT_SUPPORTED
  198. #pragma import on
  199. #endif
  200.  
  201. #if PRAGMA_ALIGN_SUPPORTED
  202. #pragma options align=mac68k
  203. #endif
  204.  
  205.  
  206. // Generic bit defs.
  207.  
  208. enum
  209. {
  210.     kBit0                        = (1 << 0),
  211.     kBit1                        = (1 << 1),
  212.     kBit2                        = (1 << 2),
  213.     kBit3                        = (1 << 3),
  214.     kBit4                        = (1 << 4),
  215.     kBit5                        = (1 << 5),
  216.     kBit6                        = (1 << 6),
  217.     kBit7                        = (1 << 7),
  218.     kBit8                        = (1 << 8),
  219.     kBit9                        = (1 << 9),
  220.     kBit10                        = (1 << 10),
  221.     kBit11                        = (1 << 11),
  222.     kBit12                        = (1 << 12),
  223.     kBit13                        = (1 << 13),
  224.     kBit14                        = (1 << 14),
  225.     kBit15                        = (1 << 15),
  226.     kBit16                        = (1 << 16),
  227.     kBit17                        = (1 << 17),
  228.     kBit18                        = (1 << 18),
  229.     kBit19                        = (1 << 19),
  230.     kBit20                        = (1 << 20),
  231.     kBit21                        = (1 << 21),
  232.     kBit22                        = (1 << 22),
  233.     kBit23                        = (1 << 23),
  234.     kBit24                        = (1 << 24),
  235.     kBit25                        = (1 << 25),
  236.     kBit26                        = (1 << 26),
  237.     kBit27                        = (1 << 27),
  238.     kBit28                        = (1 << 28),
  239.     kBit29                        = (1 << 29),
  240.     kBit30                        = (1 << 30),
  241.     kBit31                        = (1 << 31)
  242. };
  243.  
  244. #define BitRange(start, end)                        \
  245. (                                                    \
  246.     ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >>        \
  247.      ((31 - (end)) + (start))) <<                    \
  248.     (start)                                            \
  249. )
  250.  
  251. #define BitRangePhase(start, end)                    \
  252.     (start)
  253.  
  254.  
  255. ////////////////////////////////////////////////////////////////////////////////
  256. //
  257. // Standard FireWire defs.
  258. //
  259.  
  260. // FireWire bit defs.
  261.  
  262. enum
  263. {
  264.     kFWBit0                        = (1 << 31),
  265.     kFWBit1                        = (1 << 30),
  266.     kFWBit2                        = (1 << 29),
  267.     kFWBit3                        = (1 << 28),
  268.     kFWBit4                        = (1 << 27),
  269.     kFWBit5                        = (1 << 26),
  270.     kFWBit6                        = (1 << 25),
  271.     kFWBit7                        = (1 << 24),
  272.     kFWBit8                        = (1 << 23),
  273.     kFWBit9                        = (1 << 22),
  274.     kFWBit10                    = (1 << 21),
  275.     kFWBit11                    = (1 << 20),
  276.     kFWBit12                    = (1 << 19),
  277.     kFWBit13                    = (1 << 18),
  278.     kFWBit14                    = (1 << 17),
  279.     kFWBit15                    = (1 << 16),
  280.     kFWBit16                    = (1 << 15),
  281.     kFWBit17                    = (1 << 14),
  282.     kFWBit18                    = (1 << 13),
  283.     kFWBit19                    = (1 << 12),
  284.     kFWBit20                    = (1 << 11),
  285.     kFWBit21                    = (1 << 10),
  286.     kFWBit22                    = (1 << 9),
  287.     kFWBit23                    = (1 << 8),
  288.     kFWBit24                    = (1 << 7),
  289.     kFWBit25                    = (1 << 6),
  290.     kFWBit26                    = (1 << 5),
  291.     kFWBit27                    = (1 << 4),
  292.     kFWBit28                    = (1 << 3),
  293.     kFWBit29                    = (1 << 2),
  294.     kFWBit30                    = (1 << 1),
  295.     kFWBit31                    = (1 << 0)
  296. };
  297.  
  298. #define FWBitRange(start, end)                        \
  299. (                                                    \
  300.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  301.      ((start) + (31 - (end)))) <<                    \
  302.     (31 - (end))                                    \
  303. )
  304.  
  305. #define FWBitRangePhase(start, end)                    \
  306.     (31 - end)
  307.  
  308.  
  309. /*zzz Put in IEEE1212.h */
  310. ////////////////////////////////////////////////////////////////////////////////
  311. //
  312. // Define some CSR stuff.
  313. //
  314.  
  315. // CSR bit defs.
  316.  
  317. enum
  318. {
  319.     kCSRBit0                    = (1 << 31),
  320.     kCSRBit1                    = (1 << 30),
  321.     kCSRBit2                    = (1 << 29),
  322.     kCSRBit3                    = (1 << 28),
  323.     kCSRBit4                    = (1 << 27),
  324.     kCSRBit5                    = (1 << 26),
  325.     kCSRBit6                    = (1 << 25),
  326.     kCSRBit7                    = (1 << 24),
  327.     kCSRBit8                    = (1 << 23),
  328.     kCSRBit9                    = (1 << 22),
  329.     kCSRBit10                    = (1 << 21),
  330.     kCSRBit11                    = (1 << 20),
  331.     kCSRBit12                    = (1 << 19),
  332.     kCSRBit13                    = (1 << 18),
  333.     kCSRBit14                    = (1 << 17),
  334.     kCSRBit15                    = (1 << 16),
  335.     kCSRBit16                    = (1 << 15),
  336.     kCSRBit17                    = (1 << 14),
  337.     kCSRBit18                    = (1 << 13),
  338.     kCSRBit19                    = (1 << 12),
  339.     kCSRBit20                    = (1 << 11),
  340.     kCSRBit21                    = (1 << 10),
  341.     kCSRBit22                    = (1 << 9),
  342.     kCSRBit23                    = (1 << 8),
  343.     kCSRBit24                    = (1 << 7),
  344.     kCSRBit25                    = (1 << 6),
  345.     kCSRBit26                    = (1 << 5),
  346.     kCSRBit27                    = (1 << 4),
  347.     kCSRBit28                    = (1 << 3),
  348.     kCSRBit29                    = (1 << 2),
  349.     kCSRBit30                    = (1 << 1),
  350.     kCSRBit31                    = (1 << 0)
  351. };
  352.  
  353. #define CSRBitRange(start, end)                        \
  354. (                                                    \
  355.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  356.      ((start) + (31 - (end)))) <<                    \
  357.     (31 - (end))                                    \
  358. )
  359.  
  360. #define CSRBitRangePhase(start, end)                \
  361.     (31 - end)
  362.  
  363. // Core CSR registers.
  364.  
  365. enum
  366. {
  367.     kCSRStateUnitDepend            = CSRBitRange (0, 15),
  368.     kCSRStateUnitDependPhase    = CSRBitRangePhase (0, 15),
  369.  
  370.     kCSRStateBusDepend            = CSRBitRange (16, 23),
  371.     kCSRStateBusDependPhase        = CSRBitRangePhase (16, 23),
  372.  
  373.     kCSRStateLost                = kCSRBit24,
  374.     kCSRStateDReq                = kCSRBit25,
  375.     kCSRStateELog                = kCSRBit27,
  376.     kCSRStateAtn                = kCSRBit28,
  377.     kCSRStateOff                = kCSRBit29,
  378.  
  379.     kCSRStateState                = CSRBitRange (30, 31),
  380.     kCSRStateStatePhase            = CSRBitRangePhase (30, 31),
  381.     kCSRStateStateRunning        = 0,
  382.     kCSRStateStateInitializing    = 1,
  383.     kCSRStateStateTesting        = 2,
  384.     kCSRStateStateDead            = 3
  385. };
  386.  
  387. // Key values.
  388.  
  389. enum
  390. {
  391.     kCSRTextualDescriptorKey    = 0x01,
  392.     kCSRBusDependentInfoKey        = 0x02,
  393.     kCSRModuleVendorIDKey        = 0x03,
  394.     kCSRModuleHwVersionKey        = 0x04,
  395.     kCSRModuleSpecIdKey            = 0x05,
  396.     kCSRModuleSwVersionKey        = 0x06,
  397.     kCSRModuleDependentInfoKey    = 0x07,
  398.     kCSRNodeVendorIdKey            = 0x08,
  399.     kCSRNodeHwVersionKey        = 0x09,
  400.     kCSRNodeSpecIdKey            = 0x0A,
  401.     kCSRNodeSwVersionKey        = 0x0B,
  402.     kCSRNodeCapabilitiesKey        = 0x0C,
  403.     kCSRNodeUniqueIdKey            = 0x0D,
  404.     kCSRNodeUnitsExtentKey        = 0x0E,
  405.     kCSRNodeMemoryExtentKey        = 0x0F,
  406.     kCSRNodeDependentInfoKey    = 0x10,
  407.     kCSRUnitDirectoryKey        = 0x11,
  408.     kCSRUnitSpecIdKey            = 0x12,
  409.     kCSRUnitSwVersionKey        = 0x13,
  410.     kCSRUnitDependentInfoKey    = 0x14,
  411.     kCSRUnitLocationKey            = 0x15,
  412.     kCSRUnitPollMaskKey            = 0x16
  413. };
  414.  
  415.  
  416. // Key value bits for searching.
  417.  
  418. enum
  419. {
  420.     kCSREveryKey                = 0xFFFFFFFF,
  421.  
  422.     kCSRTextualDescriptorKeyLoBit    = (1 << kCSRTextualDescriptorKey),
  423.     kCSRTextualDescriptorKeyHiBit    = 0,
  424.     kCSRBusDependentInfoKeyLoBit    = (1 << kCSRBusDependentInfoKey),
  425.     kCSRBusDependentInfoKeyHiBit    = 0,
  426.     kCSRModuleVendorIDKeyLoBit        = (1 << kCSRModuleVendorIDKey),
  427.     kCSRModuleVendorIDKeyHiBit        = 0,
  428.     kCSRModuleHwVersionKeyLoBit        = (1 << kCSRModuleHwVersionKey),
  429.     kCSRModuleHwVersionKeyHiBit        = 0,
  430.     kCSRModuleSpecIdKeyLoBit        = (1 << kCSRModuleSpecIdKey),
  431.     kCSRModuleSpecIdKeyHiBit        = 0,
  432.     kCSRModuleSwVersionKeyLoBit        = (1 << kCSRModuleSwVersionKey),
  433.     kCSRModuleSwVersionKeyHiBit        = 0,
  434.     kCSRModuleDependentInfoKeyLoBit    = (1 << kCSRModuleDependentInfoKey),
  435.     kCSRModuleDependentInfoKeyHiBit    = 0,
  436.     kCSRNodeVendorIdKeyLoBit        = (1 << kCSRNodeVendorIdKey),
  437.     kCSRNodeVendorIdKeyHiBit        = 0,
  438.     kCSRNodeHwVersionKeyLoBit        = (1 << kCSRNodeHwVersionKey),
  439.     kCSRNodeHwVersionKeyHiBit        = 0,
  440.     kCSRNodeSpecIdKeyLoBit            = (1 << kCSRNodeSpecIdKey),
  441.     kCSRNodeSpecIdKeyHiBit            = 0,
  442.     kCSRNodeSwVersionKeyLoBit        = (1 << kCSRNodeSwVersionKey),
  443.     kCSRNodeSwVersionKeyHiBit        = 0,
  444.     kCSRNodeCapabilitiesKeyLoBit    = (1 << kCSRNodeCapabilitiesKey),
  445.     kCSRNodeCapabilitiesKeyHiBit    = 0,
  446.     kCSRNodeUniqueIdKeyLoBit        = (1 << kCSRNodeUniqueIdKey),
  447.     kCSRNodeUniqueIdKeyHiBit        = 0,
  448.     kCSRNodeUnitsExtentKeyLoBit        = (1 << kCSRNodeUnitsExtentKey),
  449.     kCSRNodeUnitsExtentKeyHiBit        = 0,
  450.     kCSRNodeMemoryExtentKeyLoBit    = (1 << kCSRNodeMemoryExtentKey),
  451.     kCSRNodeMemoryExtentKeyHiBit    = 0,
  452.     kCSRNodeDependentInfoKeyLoBit    = (1 << kCSRNodeDependentInfoKey),
  453.     kCSRNodeDependentInfoKeyHiBit    = 0,
  454.     kCSRUnitDirectoryKeyLoBit        = (1 << kCSRUnitDirectoryKey),
  455.     kCSRUnitDirectoryKeyHiBit        = 0,
  456.     kCSRUnitSpecIdKeyLoBit            = (1 << kCSRUnitSpecIdKey),
  457.     kCSRUnitSpecIdKeyHiBit            = 0,
  458.     kCSRUnitSwVersionKeyLoBit        = (1 << kCSRUnitSwVersionKey),
  459.     kCSRUnitSwVersionKeyHiBit        = 0,
  460.     kCSRUnitDependentInfoKeyLoBit    = (1 << kCSRUnitDependentInfoKey),
  461.     kCSRUnitDependentInfoKeyHiBit    = 0,
  462.     kCSRUnitLocationKeyLoBit        = (1 << kCSRUnitLocationKey),
  463.     kCSRUnitLocationKeyHiBit        = 0,
  464.     kCSRUnitPollMaskKeyLoBit        = (1 << kCSRUnitPollMaskKey),
  465.     kCSRUnitPollMaskKeyHiBit        = 0
  466. };
  467.  
  468.  
  469. // Key types.
  470.  
  471. enum
  472. {
  473.     kCSRImmediateKeyType        = 0,
  474.     kCSROffsetKeyType            = 1,
  475.     kCSRLeafKeyType                = 2,
  476.     kCSRDirectoryKeyType        = 3
  477. };
  478.  
  479.  
  480. // Key type bits for searching.
  481.  
  482. enum
  483. {
  484.     kCSREveryKeyType            = 0xFFFFFFFF,
  485.  
  486.     kCSRImmediateKeyTypeBit        = (1 << kCSRImmediateKeyType),
  487.     kCSROffsetKeyTypeBit        = (1 << kCSROffsetKeyType),
  488.     kCSRLeafKeyTypeBit            = (1 << kCSRLeafKeyType),
  489.     kCSRDirectoryKeyTypeBit        = (1 << kCSRDirectoryKeyType)
  490. };
  491.  
  492. // CSR ROM entry bit locations.
  493.  
  494. enum
  495. {
  496.     kCSRBusInfoBlockLength        = CSRBitRange (0, 7),
  497.     kCSRBusInfoBlockLengthPhase    = CSRBitRangePhase (0, 7),
  498.  
  499.     kCSRROMCRCLength            = CSRBitRange (8, 15),
  500.     kCSRROMCRCLengthPhase        = CSRBitRangePhase (8, 15),
  501.  
  502.     kCSRROMCRCValue                = CSRBitRange (16, 31),
  503.     kCSRROMCRCValuePhase        = CSRBitRangePhase (16, 31),
  504.  
  505.     kCSREntryKeyType            = CSRBitRange (0, 1),
  506.     kCSREntryKeyTypePhase        = CSRBitRangePhase (0, 1),
  507.  
  508.     kCSREntryKeyValue            = CSRBitRange (2, 7),
  509.     kCSREntryKeyValuePhase        = CSRBitRangePhase (2, 7),
  510.  
  511.     kCSREntryValue                = CSRBitRange (8, 31),
  512.     kCSREntryValuePhase            = CSRBitRangePhase (8, 31),
  513.  
  514.     kCSRLeafDirLength            = CSRBitRange (0, 15),
  515.     kCSRLeafDirLengthPhase        = CSRBitRangePhase (0, 15),
  516.  
  517.     kCSRLeafDirCRC                = CSRBitRange (16, 31),
  518.     kCSRLeafDirCRCPhase            = CSRBitRangePhase (16, 31)
  519. };
  520.  
  521. // CSR 64-bit fixed address defs.
  522.  
  523. enum
  524. {
  525.     kCSRNodeID                    = CSRBitRange (0, 15),
  526.     kCSRNodeIDPhase                = CSRBitRangePhase (0, 15),
  527.  
  528.     kCSRInitialMemorySpaceBaseAddressHi
  529.                                 = 0x00000000,
  530.     kCSRInitialMemorySpaceBaseAddressLo
  531.                                 = 0x00000000,
  532.  
  533.     kCSRPrivateSpaceBaseAddressHi
  534.                                 = 0x0000FFFF,
  535.     kCSRPrivateSpaceBaseAddressLo
  536.                                 = 0xE0000000,
  537.  
  538.     kCSRRegisterSpaceBaseAddressHi
  539.                                 = 0x0000FFFF,
  540.     kCSRRegisterSpaceBaseAddressLo
  541.                                 = 0xF0000000,
  542.  
  543.     kCSRCoreRegistersBaseAddress
  544.                                 = kCSRRegisterSpaceBaseAddressLo,
  545.     kCSRStateClearAddress        = kCSRCoreRegistersBaseAddress + 0x0000,
  546.     kCSRStateSetAddress            = kCSRCoreRegistersBaseAddress + 0x0004,
  547.     kCSRNodeIDsAddress            = kCSRCoreRegistersBaseAddress + 0x0008,
  548.     kCSRResetStartAddress        = kCSRCoreRegistersBaseAddress + 0x000C,
  549.     kCSRIndirectAddressAddress    = kCSRCoreRegistersBaseAddress + 0x0010,
  550.     kCSRIndirectDataAddress        = kCSRCoreRegistersBaseAddress + 0x0014,
  551.     kCSRSplitTimeoutHiAddress    = kCSRCoreRegistersBaseAddress + 0x0018,
  552.     kCSRSplitTimeoutLoAddress    = kCSRCoreRegistersBaseAddress + 0x001C,
  553.     kCSRArgumentHiAddress        = kCSRCoreRegistersBaseAddress + 0x0020,
  554.     kCSRArgumentLoAddress        = kCSRCoreRegistersBaseAddress + 0x0024,
  555.     kCSRTestStartAddress        = kCSRCoreRegistersBaseAddress + 0x0028,
  556.     kCSRTestStatusAddress        = kCSRCoreRegistersBaseAddress + 0x002C,
  557.     kCSRUnitsBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0030,
  558.     kCSRUnitsBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0034,
  559.     kCSRUnitsBoundHiAddress        = kCSRCoreRegistersBaseAddress + 0x0038,
  560.     kCSRUnitsBoundLoAddress        = kCSRCoreRegistersBaseAddress + 0x003C,
  561.     kCSRMemoryBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0040,
  562.     kCSRMemoryBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0044,
  563.     kCSRMemoryBoundHiAddress    = kCSRCoreRegistersBaseAddress + 0x0048,
  564.     kCSRMemoryBoundLoAddress    = kCSRCoreRegistersBaseAddress + 0x004C,
  565.     kCSRInterruptTargetAddress    = kCSRCoreRegistersBaseAddress + 0x0050,
  566.     kCSRInterruptMaskAddress    = kCSRCoreRegistersBaseAddress + 0x0054,
  567.     kCSRClockValueHiAddress        = kCSRCoreRegistersBaseAddress + 0x0058,
  568.     kCSRClockValueMidAddress    = kCSRCoreRegistersBaseAddress + 0x005C,
  569.     kCSRClockTickPeriodMidAddress
  570.                                 = kCSRCoreRegistersBaseAddress + 0x0060,
  571.     kCSRClockTickPeriodLoAddress
  572.                                 = kCSRCoreRegistersBaseAddress + 0x0064,
  573.     kCSRClockStrobeArrivedHiAddress
  574.                                 = kCSRCoreRegistersBaseAddress + 0x0068,
  575.     kCSRClockStrobeArrivedMidAddress
  576.                                 = kCSRCoreRegistersBaseAddress + 0x006C,
  577.     kCSRClockInfo0Address        = kCSRCoreRegistersBaseAddress + 0x0070,
  578.     kCSRClockInfo1Address        = kCSRCoreRegistersBaseAddress + 0x0074,
  579.     kCSRClockInfo2Address        = kCSRCoreRegistersBaseAddress + 0x0078,
  580.     kCSRClockInfo3Address        = kCSRCoreRegistersBaseAddress + 0x007C,
  581.     kCSRMessageRequestAddress    = kCSRCoreRegistersBaseAddress + 0x0080,
  582.     kCSRMessageResponseAddress    = kCSRCoreRegistersBaseAddress + 0x00C0,
  583.     kCSRErrorLogBufferAddress    = kCSRCoreRegistersBaseAddress + 0x0180,
  584.  
  585.     kCSRBusDependentRegistersBaseAddress
  586.                                 = kCSRRegisterSpaceBaseAddressLo + 0x0200,
  587.  
  588.     kCSRROMBaseAddress            = kCSRRegisterSpaceBaseAddressLo + 0x0400,
  589.     kCSRBIBHeaderAddress        = kCSRROMBaseAddress,
  590.     kCSRBIBBusNameAddress        = kCSRROMBaseAddress + 4
  591. };
  592.  
  593.  
  594. // CSR ROM search data types and structures.
  595.  
  596. enum {
  597. /*
  598.     ** Absolute locations
  599.     */
  600.     kIterateRoot                = 0x2L,
  601. /*
  602.     ** "Upward" Relationships    
  603.     */
  604.     kIterateParents                = 0x3L,                            /* include all  parent(s) of entry */
  605. /*
  606.     ** "Downward" Relationships
  607.     //
  608.     */
  609.     kIterateChildren            = 0x4L,                            /* include all children */
  610.     kIterateSubTrees            = 0x5L,                            /* include all sub trees of entry */
  611.     kIterateDescendants            = 0x5L,                            /* include all descendants of entry */
  612. /*
  613.     ** "Horizontal" Relationships    
  614.     */
  615.     kIterateSibling                = 0x6L,                            /* include all siblings */
  616. /*
  617.     ** Keep doing the same thing
  618.     */
  619.     kIterateContinue            = 0x1L
  620. };
  621.  
  622. enum
  623. {
  624.     kInvalidCSRROMIterator        = 0
  625. };
  626.  
  627. enum
  628. {
  629.     kCSRROMSearchForKey            = 1
  630. };
  631.  
  632. enum
  633. {
  634.     kInvalidCSRROMEntryType        = 0xFFFFFFFF,
  635.     kImmediateCSRROMEntryType    = 0,
  636.     kOffsetCSRROMEntryType        = 1,
  637.     kLeafCSRROMEntryType        = 2,
  638.     kDirectoryCSRROMEntryType    = 3
  639. };
  640.  
  641. enum
  642. {
  643.     kInvalidCSRROMEntryID        = 0                        // zzz should use generic invalid ID
  644. };
  645.  
  646. // CSR defined 64 bit unique ID.
  647.  
  648. struct CSRNodeUniqueIDStruct
  649. {
  650.     UInt32                        hi,
  651.                                 lo;                        // Hi and lo values of 64 bit unique ID.
  652. };
  653. typedef struct CSRNodeUniqueIDStruct
  654.                                 CSRNodeUniqueID,
  655.                                 *CSRNodeUniqueIDPtr;
  656.  
  657. typedef UInt32                    CSRROMEntryIterator;
  658. typedef UInt32                    CSRROMIterationOp;
  659. typedef KernelID                CSRROMEntryID;
  660.  
  661. struct CSRROMSearchCriteriaStruct
  662. {
  663.     UInt32                        csrROMSearchType;        // Type of search record.
  664.     UInt32                        keyType;                // Key types to search for.
  665.     UInt32                        keyHi,                    // Key values to search for.
  666.                                 keyLo;                    //zzz ought to provide nice way to set these.
  667. };
  668. typedef struct CSRROMSearchCriteriaStruct
  669.                                 CSRROMSearchCriteria,
  670.                                 *CSRROMSearchCriteriaPtr;
  671.  
  672. /*zzz End put in IEEE1212.h */
  673.  
  674.  
  675. ////////////////////////////////////////////////////////////////////////////////
  676. //
  677. // FireWire CSR defs.
  678. //
  679.  
  680. // FireWire core CSR registers.
  681.  
  682. enum
  683. {
  684.     kFWCSRStateGone                = kFWBit16,
  685.     kFWCSRStateLinkOff            = kFWBit22,
  686.     kFWCSRStateCMstr            = kFWBit23
  687. };
  688.  
  689. // FireWire bus/nodeID address defs.
  690.  
  691. enum
  692. {
  693.     kFWAddressBusID                = FWBitRange (16, 25) << kCSRNodeIDPhase,
  694.     kFWAddressBusIDPhase        = FWBitRangePhase (16, 25) + kCSRNodeIDPhase,
  695.  
  696.     kFWAddressNodeID            = FWBitRange (26, 31) << kCSRNodeIDPhase,
  697.     kFWAddressNodeIDPhase        = FWBitRangePhase (26, 31) + kCSRNodeIDPhase,
  698.  
  699.     kFWLocalBusID                = 1023,
  700.     kFWBroadcastNodeID            = 63,
  701.  
  702.     kFWLocalBusAddress            = kFWLocalBusID << kFWAddressBusIDPhase,
  703.     kFWBroadcastAddress            = kFWBroadcastNodeID << kFWAddressNodeIDPhase
  704. };
  705.  
  706. #define FWNodeBaseAddress(busID, nodeID)                                                \
  707. (                                                                                        \
  708.     (busID << kFWAddressBusIDPhase) |                                                    \
  709.     (nodeID << kFWAddressNodeIDPhase)                                                    \
  710. )
  711.  
  712. #define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID)                                    \
  713. (                                                                                        \
  714.     FWNodeBaseAddress (busID, nodeID) |                                                    \
  715.     kCSRRegisterSpaceBaseAddressHi                                                        \
  716. )
  717.  
  718.  
  719. // FireWire CSR bus info block defs.
  720.  
  721. enum
  722. {
  723.     kFWBIBHeaderAddress            = kCSRBIBHeaderAddress,
  724.     kFWBIBBusNameAddress        = kCSRBIBBusNameAddress,
  725.     kFWBIBNodeCapabilitiesAddress
  726.                                 = kCSRROMBaseAddress + 8,
  727.     kFWBIBNodeUniqueIDHiAddress    = kCSRROMBaseAddress + 12,
  728.     kFWBIBNodeUniqueIDLoAddress    = kCSRROMBaseAddress + 16,
  729.  
  730.     kFWBIBBusName                = '1394',
  731.  
  732.     kFWBIBIrmc                    = kFWBit0,
  733.     kFWBIBCmc                    = kFWBit1,
  734.     kFWBIBIsc                    = kFWBit2,
  735.     kFWBIBBmc                    = kFWBit3,
  736.     kFWBIBCycClkAcc                = FWBitRange (8, 15),
  737.     kFWBIBCycClkAccPhase        = FWBitRangePhase (8, 15),
  738.     kFWBIBMaxRec                = FWBitRange (16, 19),
  739.     kFWBIBMaxRecPhase            = FWBitRangePhase (16, 19)
  740. };
  741.  
  742.  
  743. ////////////////////////////////////////////////////////////////////////////////
  744. //
  745. // FireWire ID defs.
  746. //
  747.  
  748. typedef KernelID                FWReferenceID;
  749. typedef FWReferenceID            FWIMID;
  750. typedef FWReferenceID            FWDeviceID;
  751. typedef FWReferenceID            FWUnitID;
  752. typedef FWReferenceID            FWClientID;
  753. typedef FWReferenceID            FWDriverID;
  754. typedef FWReferenceID            FWVDeviceID;
  755. typedef FWReferenceID            FWPDriverID;
  756. typedef FWReferenceID            FWIsochResourceManagerID;
  757. typedef KernelID                FWCommandObjectID;
  758. typedef KernelID                FWCommandID;
  759. typedef KernelID                FWIMCommandID;
  760. typedef KernelID                FWClientCommandID;
  761. typedef KernelID                FWIMProcessID;
  762. typedef KernelID                IsochChannelID;
  763. typedef KernelID                IsochPortID;
  764. typedef KernelID                DCLProgramID;
  765. typedef KernelID                FWAddressSpaceID;
  766. typedef KernelID                FWDeferredTaskID;
  767.  
  768. enum
  769. {
  770.     kInvalidFWReferenceID        = 0,                    // zzz should use generic invalid ID
  771.     kInvalidFWIMID                = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWIM
  772.     kInvalidFWDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  773.     kInvalidFWUnitID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  774.     kInvalidFWClientID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  775.     kInvalidFWDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  776.     kInvalidFWVDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  777.     kInvalidFWPDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  778.     kInvalidFWIsochResourceManagerID    = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  779.     kInvalidFWCommandObjectID    = 0,                    // zzz should use generic invalid ID
  780.     kInvalidFWCommandID            = 0,                    // zzz should use generic invalid ID
  781.     kInvalidFWIMCommandID        = 0,                    // zzz should use generic invalid ID
  782.     kInvalidFWClientCommandID    = 0,                    // zzz should use generic invalid ID
  783.     kInvalidFWIMProcessID        = 0,                    // zzz should use generic invalid ID
  784.     kInvalidIsochChannelID        = 0,                    // zzz should use generic invalid ID
  785.     kInvalidIsochPortID            = 0,                    // zzz should use generic invalid ID ID for an invalid FWIM
  786.     kInvalidDCLProgramID        = 0,                    // zzz should use generic invalid ID
  787.     kInvalidFWAddressSpaceID    = 0,                    // zzz should use generic invalid ID
  788.     kInvalidFWDeferredTaskID    = 0                        // zzz should use generic invalid ID
  789. };
  790.  
  791.  
  792. ////////////////////////////////////////////////////////////////////////////////
  793. //
  794. // FireWire deferred task defs.
  795. //
  796.  
  797. typedef void    (FWDeferredTaskProc) (
  798.     void                        *param1,
  799.     void                        *param2);
  800. typedef FWDeferredTaskProc        *FWDeferredTaskProcPtr;
  801.  
  802.  
  803. ////////////////////////////////////////////////////////////////////////////////
  804. //
  805. // Address space defs.
  806. //
  807.  
  808. enum
  809. {
  810.     kFWAddressWriteEnable            = kFWBit31,
  811.     kFWAddressWriteRequestNotify    = kFWBit30,
  812.     kFWAddressWriteCompleteNotify    = kFWBit29,
  813.     kFWAddressReadEnable            = kFWBit28,
  814.     kFWAddressReadRequestNotify        = kFWBit27,
  815.     kFWAddressReadCompleteNotify    = kFWBit26,
  816.     kFWAddressLockEnable            = kFWBit25,
  817.     kFWAddressLockRequestNotify        = kFWBit24,
  818.     kFWAddressLockCompleteNotify    = kFWBit23,
  819.     kFWAddressLocation                = FWBitRange (21, 22),
  820.     kFWAddressLocationPhase            = FWBitRangePhase (21, 22),
  821.     kFWAddressInitialMemorySpace    = 0,
  822.     kFWAddressPrivateSpace            = 1,
  823.     kFWAddressInitialUnitsSpace        = 2,
  824.     kFWAddressOffsetInitialUnitsSpace    = 3
  825. };
  826.  
  827.  
  828. ////////////////////////////////////////////////////////////////////////////////
  829. //
  830. // Isochronous channel defs.
  831. //
  832.  
  833. enum
  834. {
  835.     kFWIsochChannelUnknownCondition        = 0,
  836.     kFWIsochChannelNotEnoughBandwidth    = 1,
  837.     kFWIsochChannelChannelNotAvailable    = 2
  838. };
  839.  
  840. typedef OSStatus    (FWIsochChannelForceStopNotificationProc) (
  841.     IsochChannelID                isochChannelID,
  842.     UInt32                        stopCondition);
  843. typedef FWIsochChannelForceStopNotificationProc
  844.                                 *FWIsochChannelForceStopNotificationProcPtr;
  845.  
  846.  
  847. ////////////////////////////////////////////////////////////////////////////////
  848. //
  849. // Isochronous channel defs.
  850. //
  851.  
  852. enum
  853. {
  854.     kFWDCLImmediateEvent        = 0,
  855.     kFWDCLCycleEvent            = 1,
  856.     kFWDCLSyBitsEvent            = 2
  857. };
  858.  
  859. enum
  860. {
  861.     kFWDCLInvalidNotification    = 0,
  862.     kFWDCLUpdateNotification    = 1,
  863.     kFWDCLModifyNotification    = 2
  864. };
  865.  
  866. enum
  867. {
  868.     kFWDCLOpDynamicFlag            = (1 << 16),
  869.     kFWDCLOpVendorDefinedFlag    = (1 << 17),
  870.     kFWDCLOpFlagMask            = BitRange (16, 31),
  871.     kFWDCLOpFlagPhase            = BitRangePhase (16, 31)
  872. };
  873.  
  874. enum
  875. {
  876.     kDCLInvalidOp                = 0,
  877.     kDCLSendPacketStartOp        = 1,
  878.     kDCLSendPacketWithHeaderStartOp
  879.                                 = 2,
  880.     kDCLSendPacketOp            = 3,
  881.     kDCLSendBufferOp            = 4,
  882.     kDCLReceivePacketStartOp    = 5,
  883.     kDCLReceivePacketOp            = 6,
  884.     kDCLReceiveBufferOp            = 7,
  885.     kDCLCallProcOp                = 8,
  886.     kDCLLabelOp                    = 9,
  887.     kDCLJumpOp                    = 10,
  888.     kDCLSetTagSyncBitsOp        = 11,
  889.     kDCLUpdateDCLListOp            = 12,
  890.     kDCLTimeStampOp                = 13
  891. };
  892.  
  893. typedef struct DCLCommandStruct
  894.                                 DCLCommand,
  895.                                 *DCLCommandPtr;
  896.  
  897. struct DCLCommandStruct
  898. {
  899.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  900.     UInt32                        compilerData;            // Data for use by DCL compiler.
  901.     UInt32                        opcode;                    // DCL opcode.
  902.     UInt32                        operands[1];            // DCL operands.
  903. };
  904.  
  905. struct DCLTransferPacketStruct
  906. {
  907.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  908.     UInt32                        compilerData;            // Data for use by DCL compiler.
  909.     UInt32                        opcode;                    // DCL opcode.
  910.     Ptr                            buffer;                    // Packet buffer.
  911.     UInt32                        size;                    // Buffer size.
  912. };
  913. typedef struct DCLTransferPacketStruct
  914.                                 DCLTransferPacket,
  915.                                 *DCLTransferPacketPtr;
  916.  
  917. struct DCLTransferBufferStruct
  918. {
  919.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  920.     UInt32                        compilerData;            // Data for use by DCL compiler.
  921.     UInt32                        opcode;                    // DCL opcode.
  922.     Ptr                            buffer;                    // Buffer.
  923.     UInt32                        size;                    // Buffer size.
  924.     UInt16                        packetSize;                // Size of packets to send.
  925.     UInt16                        reserved;
  926.     UInt32                        bufferOffset;            // Current offset into buffer.
  927. };
  928. typedef struct DCLTransferBufferStruct
  929.                                 DCLTransferBuffer,
  930.                                 *DCLTransferBufferPtr;
  931.  
  932. typedef void    (DCLCallCommandProc) (
  933.     DCLCommandPtr                pDCLCommand);
  934. typedef DCLCallCommandProc        *DCLCallCommandProcPtr;
  935.  
  936. struct DCLCallProcStruct
  937. {
  938.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  939.     UInt32                        compilerData;            // Data for use by DCL compiler.
  940.     UInt32                        opcode;                    // DCL opcode.
  941.     DCLCallCommandProcPtr        proc;                    // Procedure to call.
  942.     UInt32                        procData;                // Data for use by called procedure.
  943. };
  944. typedef struct DCLCallProcStruct
  945.                                 DCLCallProc,
  946.                                 *DCLCallProcPtr;
  947.  
  948. struct DCLLabelStruct
  949. {
  950.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  951.     UInt32                        compilerData;            // Data for use by DCL compiler.
  952.     UInt32                        opcode;                    // DCL opcode.
  953. };
  954. typedef struct DCLLabelStruct
  955.                                 DCLLabel,
  956.                                 *DCLLabelPtr;
  957.  
  958. struct DCLJumpStruct
  959. {
  960.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  961.     UInt32                        compilerData;            // Data for use by DCL compiler.
  962.     UInt32                        opcode;                    // DCL opcode.
  963.     DCLLabelPtr                    pJumpDCLLabel;            // DCL label to jump to.
  964. };
  965. typedef struct DCLJumpStruct
  966.                                 DCLJump,
  967.                                 *DCLJumpPtr;
  968.  
  969. struct DCLSetTagSyncBitsStruct
  970. {
  971.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  972.     UInt32                        compilerData;            // Data for use by DCL compiler.
  973.     UInt32                        opcode;                    // DCL opcode.
  974.     UInt16                        tagBits;                // Tag bits for following packets.
  975.     UInt16                        syncBits;                // Sync bits for following packets.
  976. };
  977. typedef struct DCLSetTagSyncBitsStruct
  978.                                 DCLSetTagSyncBits,
  979.                                 *DCLSetTagSyncBitsPtr;
  980.  
  981. struct DCLUpdateDCLListStruct
  982. {
  983.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  984.     UInt32                        compilerData;            // Data for use by DCL compiler.
  985.     UInt32                        opcode;                    // DCL opcode.
  986.     DCLCommandPtr                *dclCommandList;        // List of DCL commands to update.
  987.     UInt32                        numDCLCommands;            // Number of DCL commands in list.
  988. };
  989. typedef struct DCLUpdateDCLListStruct
  990.                                 DCLUpdateDCLList,
  991.                                 *DCLUpdateDCLListPtr;
  992.  
  993. struct DCLTimeStampStruct
  994. {
  995.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  996.     UInt32                        compilerData;            // Data for use by DCL compiler.
  997.     UInt32                        opcode;                    // DCL opcode.
  998.     UInt32                        timeStamp;                // Time stamp.
  999. };
  1000. typedef struct DCLTimeStampStruct
  1001.                                 DCLTimeStamp,
  1002.                                 *DCLTimeStampPtr;
  1003.  
  1004. typedef OSStatus    (DCLProgramStartProc) (
  1005.     DCLProgramID                dclProgramID);
  1006. typedef DCLProgramStartProc        *DCLProgramStartProcPtr;
  1007.  
  1008. typedef OSStatus    (DCLProgramStopProc) (
  1009.     DCLProgramID                dclProgramID);
  1010. typedef DCLProgramStopProc        *DCLProgramStopProcPtr;
  1011.  
  1012. typedef OSStatus    (DCLProgramReleaseProc) (
  1013.     DCLProgramID                dclProgramID);
  1014. typedef DCLProgramReleaseProc    *DCLProgramReleaseProcPtr;
  1015.  
  1016. typedef OSStatus    (DCLCompilerNotificationProc) (
  1017.     DCLProgramID                dclProgramID,
  1018.     UInt32                        notificationType,
  1019.     DCLCommandPtr                *dclCommandList,
  1020.     UInt32                        numDCLCommands);
  1021. typedef DCLCompilerNotificationProc
  1022.                                 *DCLCompilerNotificationProcPtr;
  1023.  
  1024.  
  1025. ////////////////////////////////////////////////////////////////////////////////
  1026. //
  1027. // Define some bus management constants.
  1028. //
  1029.  
  1030. enum
  1031. {
  1032.     kFWBusManagerArbitrationTimeoutDuration
  1033.                                 = 625 * durationMillisecond
  1034. };
  1035.  
  1036.  
  1037. ////////////////////////////////////////////////////////////////////////////////
  1038. //
  1039. // Define some bus characteristics.
  1040. //
  1041.  
  1042. enum
  1043. {
  1044.     kFWMaxBusses                = 1023,
  1045.     kFWMaxNodesPerBus            = 63,
  1046.     kFWMaxNodeHops                = 16
  1047. };
  1048.  
  1049.  
  1050. ////////////////////////////////////////////////////////////////////////////////
  1051. //
  1052. // Packet defs.
  1053. //
  1054.  
  1055. // Phy packet defs.
  1056.  
  1057. enum
  1058. {
  1059.     kFWPhyPacketID                = FWBitRange (0, 1),
  1060.     kFWPhyPacketIDPhase            = FWBitRangePhase (0, 1),
  1061.  
  1062.     kFWPhyPacketPhyID            = FWBitRange (2, 7),
  1063.     kFWPhyPacketPhyIDPhase        = FWBitRangePhase (2, 7)
  1064. };
  1065.  
  1066. enum
  1067. {
  1068.     kSelfIDPacketSize            = 8,//zzz add FW
  1069.     kMaxSelfIDPacketsPerNode    = 9//zzz add FW
  1070. };
  1071.  
  1072. enum
  1073. {
  1074.     kFWConfigurationPacketID    = 0,
  1075.     kFWLinkOnPacketID            = 1,
  1076.     kFWSelfIDPacketID            = 2
  1077. };
  1078.  
  1079. enum
  1080. {
  1081.     kFWPhyConfigurationR        = kFWBit8,
  1082.     kFWPhyConfigurationT        = kFWBit9,
  1083.     kFWPhyConfigurationGapCnt    = FWBitRange (10, 15),
  1084.     kFWPhyConfigurationGapCntPhase
  1085.                                 = FWBitRangePhase (10, 15)
  1086. };
  1087.  
  1088. enum
  1089. {
  1090.     kFWSelfIDPortStatusChild    = 3,
  1091.     kFWSelfIDPortStatusParent    = 2,
  1092.     kFWSelfIDPortStatusNotConnected    = 1,
  1093.     kFWSelfIDPortStatusNotPresent    = 0,
  1094.  
  1095.     kFWSelfIDNoPower            = 0,
  1096.     kFWSelfIDSelfPowered15W        = 1,
  1097.     kFWSelfIDSelfPowered30W        = 2,
  1098.     kFWSelfIDSelfPowered45W        = 3,
  1099.     kFWSelfIDBusPowered1W        = 4,
  1100.     kFWSelfIDBusPowered3W        = 5,
  1101.     kFWSelfIDBusPowered6W        = 6,
  1102.     kFWSelfIDBusPowered10W        = 7,
  1103.  
  1104.     kFWSelfIDPhyID                = kFWPhyPacketPhyID,//zzz do we need or want this?
  1105.     kFWSelfIDPhyIDPhase            = kFWPhyPacketPhyIDPhase,
  1106.     kFWSelfIDM                    = kFWBit31,
  1107.  
  1108.     kFWSelfID0L                    = kFWBit9,
  1109.     kFWSelfID0GapCnt            = FWBitRange (10, 15),
  1110.     kFWSelfID0GapCntPhase        = FWBitRangePhase (10, 15),
  1111.     kFWSelfID0SP                = FWBitRange (16, 17),
  1112.     kFWSelfID0SPPhase            = FWBitRangePhase (16, 17),
  1113.     kFWSelfID0Del                = FWBitRange (18, 19),
  1114.     kFWSelfID0DelPhase            = FWBitRangePhase (18, 19),
  1115.     kFWSelfID0C                    = kFWBit20,
  1116.     kFWSelfID0Pwr                = FWBitRange (21, 23),
  1117.     kFWSelfID0PwrPhase            = FWBitRangePhase (21, 23),
  1118.     kFWSelfID0P0                = FWBitRange (24, 25),
  1119.     kFWSelfID0P0Phase            = FWBitRangePhase (24, 25),
  1120.     kFWSelfID0P1                = FWBitRange (26, 27),
  1121.     kFWSelfID0P1Phase            = FWBitRangePhase (26, 27),
  1122.     kFWSelfID0P2                = FWBitRange (28, 29),
  1123.     kFWSelfID0P2Phase            = FWBitRangePhase (28, 29),
  1124.     kFWSelfID0I                    = kFWBit30,
  1125.  
  1126.     kFWSelfIDNN                    = FWBitRange (10, 11),
  1127.     kFWSelfIDNNPhase            = FWBitRangePhase (10, 11),
  1128.     kFWSelfIDNPa                = FWBitRange (14, 15),
  1129.     kFWSelfIDNPaPhase            = FWBitRangePhase (14, 15),
  1130.     kFWSelfIDNPb                = FWBitRange (16, 17),
  1131.     kFWSelfIDNPbPhase            = FWBitRangePhase (16, 17),
  1132.     kFWSelfIDNPc                = FWBitRange (18, 19),
  1133.     kFWSelfIDNPcPhase            = FWBitRangePhase (18, 19),
  1134.     kFWSelfIDNPd                = FWBitRange (20, 21),
  1135.     kFWSelfIDNPdPhase            = FWBitRangePhase (20, 21),
  1136.     kFWSelfIDNPe                = FWBitRange (22, 23),
  1137.     kFWSelfIDNPePhase            = FWBitRangePhase (22, 23),
  1138.     kFWSelfIDNPf                = FWBitRange (24, 25),
  1139.     kFWSelfIDNPfPhase            = FWBitRangePhase (24, 25),
  1140.     kFWSelfIDNPg                = FWBitRange (26, 27),
  1141.     kFWSelfIDNPgPhase            = FWBitRangePhase (26, 27),
  1142.     kFWSelfIDNPh                = FWBitRange (28, 29),
  1143.     kFWSelfIDNPhPhase            = FWBitRangePhase (28, 29)
  1144. };
  1145.  
  1146. // Primary packet defs.
  1147.  
  1148. enum
  1149. {
  1150.     kFWSpeed100MBit                = 0,
  1151.     kFWSpeed200MBit                = 1,
  1152.     kFWSpeed400MBit                = 2,
  1153.     kFWSpeedMaximum                = 0x7FFFFFFF,            //zzz what are the best numbers???
  1154.     kFWSpeedInvalid                = 0x80000000
  1155. };
  1156.  
  1157. enum
  1158. {
  1159.     kFWTCodeWriteQuadlet        = 0,
  1160.     kFWTCodeWriteBlock            = 1,
  1161.     kFWTCodeWriteResponse        = 2,
  1162.     kFWTCodeReadQuadlet            = 4,
  1163.     kFWTCodeReadBlock            = 5,
  1164.     kFWTCodeReadQuadletResponse    = 6,
  1165.     kFWTCodeReadBlockResponse    = 7,
  1166.     kFWTCodeCycleStart            = 8,
  1167.     kFWTCodeLock                = 9,
  1168.     kFWTCodeIsochronousBlock    = 10,
  1169.     kFWTCodeLockResponse        = 11
  1170. };
  1171.  
  1172. enum
  1173. {
  1174.     kFWExtendedTCodeMaskSwap    = 1,
  1175.     kFWExtendedTCodeCompareSwap    = 2,
  1176.     kFWExtendedTCodeFetchAdd    = 3,
  1177.     kFWExtendedTCodeLittleAdd    = 4,
  1178.     kFWExtendedTCodeBoundedAdd    = 5,
  1179.     kFWExtendedTCodeWrapAdd        = 6,
  1180.     kFWExtendedTCodeVendorDependent    = 7
  1181. };
  1182.  
  1183. enum
  1184. {
  1185.     kFWResponseComplete            = 0,
  1186.     kFWResponseConflictError    = 4,
  1187.     kFWResponseDataError        = 5,
  1188.     kFWResponseTypeError        = 6,
  1189.     kFWResponseAddressError        = 7
  1190. };
  1191.  
  1192. enum
  1193. {
  1194.     kFWAckComplete                = 1,
  1195.     kFWAckPending                = 2,
  1196.     kFWAckBusyX                    = 3,
  1197.     kFWAckBusyA                    = 4,
  1198.     kFWAckBusyB                    = 5,
  1199.     kFWAckDataError                = 13,
  1200.     kFWAckTypeError                = 14
  1201. };
  1202.  
  1203.  
  1204. enum
  1205. {
  1206.     kFWIsochDataLength            = FWBitRange (0, 15),
  1207.     kFWIsochDataLengthPhase        = FWBitRangePhase (0, 15),
  1208.     
  1209.     kFWIsochTag                    = FWBitRange (16, 17),
  1210.     kFWIsochTagPhase            = FWBitRangePhase (16, 17),
  1211.  
  1212.     kFWIsochChanNum                = FWBitRange (18, 23),
  1213.     kFWIsochChanNumPhase        = FWBitRangePhase (18, 23),
  1214.  
  1215.     kFWIsochTCode                = FWBitRange (24, 27),
  1216.     kFWIsochTCodePhase            = FWBitRangePhase (24, 27),
  1217.  
  1218.     kFWIsochSy                    = FWBitRange (28, 31),
  1219.     kFWIsochSyPhase                = FWBitRangePhase (28, 31)
  1220. };
  1221.  
  1222.  
  1223. // Topology map.
  1224.  
  1225. enum
  1226. {
  1227.     kFWTopologyMapMaxSelfIDs    = kFWMaxNodesPerBus * kMaxSelfIDPacketsPerNode
  1228. };
  1229.  
  1230. struct FWTopologyMapStruct
  1231. {
  1232.     UInt16                        length;
  1233.     UInt16                        CRC;
  1234.     UInt32                        generationNumber;
  1235.     UInt16                        nodeCount;
  1236.     UInt16                        selfIDCount;
  1237.     UInt32                        selfIDs[kFWTopologyMapMaxSelfIDs];
  1238. };
  1239. typedef struct FWTopologyMapStruct
  1240.                                 FWTopologyMap,
  1241.                                 *FWTopologyMapPtr;
  1242.  
  1243. // Speed map.
  1244.  
  1245. enum
  1246. {
  1247.     kFWSpeedMapMaxSpeedCodes    = (kFWMaxNodesPerBus + 1) * (kFWMaxNodesPerBus - 1) +
  1248.                                   (kFWMaxNodesPerBus - 1)
  1249. };
  1250.  
  1251. struct FWSpeedMapStruct
  1252. {
  1253.     UInt16                        length;
  1254.     UInt16                        CRC;
  1255.     UInt32                        generationNumber;
  1256.     UInt8                        speedCodes[kFWSpeedMapMaxSpeedCodes];
  1257. };
  1258. typedef struct FWSpeedMapStruct    FWSpeedMap,
  1259.                                 *FWSpeedMapPtr;
  1260.  
  1261. ////////////////////////////////////////////////////////////////////////////////
  1262. //
  1263. // FireWire client defs.
  1264. //
  1265.  
  1266. enum
  1267. {
  1268.     kFWClientCommandQueueActiveBit    = 0,
  1269.     kFWClientCommandQueueActiveByte    = 1,
  1270.     kFWClientCommandQueueActive        = (1 << kFWClientCommandQueueActiveBit)
  1271. };
  1272.  
  1273. enum
  1274. {
  1275.     kFWClientCommandBusy        = 1,
  1276.     kFWClientCommandWaiting        = 2
  1277. };
  1278.  
  1279. enum
  1280. {
  1281.     kFWClientCommandSyncFlag    = (1 << 0),
  1282.     kFWClientCommandImmediateFlag    = (1 << 1)
  1283. };
  1284.  
  1285. enum
  1286. {
  1287.     kFWClientCommandAcceptNoMore
  1288.                                 = 0,
  1289.     kFWClientCommandAcceptMore    = 1,
  1290.     kFWClientCommandRejected    = 2
  1291. };
  1292.  
  1293. enum
  1294. {
  1295.     kFWClientResetNotify        = 1,                    // Notify client that a reset occured.
  1296.     kFWClientBusManagementNotify    = 2,                // Notify client that a reset occured and bus management has been established.
  1297.     kFWClientReadRequest        = 3,                    // Read request from client's address space.
  1298.     kFWClientReadComplete        = 4,                    // Read complete from client's address space.
  1299.     kFWClientWriteRequest        = 5,                    // Write request to a client's address space.
  1300.     kFWClientWriteComplete        = 6,                    // Write complete to a client's address space.
  1301.     kFWClientLockRequest        = 7,                    // Lock request to a client's address space.
  1302.     kFWClientLockComplete        = 8,                    // Lock complete to a client's address space.
  1303.     kFWClientInitIsochPort        = 9,                    // Initialize an isochronous port.
  1304.     kFWClientReleaseIsochPort    = 10,                    // Release resources allocated for isochronous port.
  1305.     kFWClientStartIsochPort        = 11,                    // Start data flow through isoch port.
  1306.     kFWClientStopIsochPort        = 12                    // Stop data flow through isoch port.
  1307. };
  1308.  
  1309.  
  1310. // Define FireWire Client command param structures.
  1311.  
  1312. typedef struct FWClientInterfaceParamsStruct
  1313.                                 FWClientInterfaceParams,
  1314.                                 *FWClientInterfaceParamsPtr;
  1315.  
  1316. typedef void    (FWClientCommandCompletionProc) (
  1317.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams);
  1318. typedef FWClientCommandCompletionProc
  1319.                                 *FWClientCommandCompletionProcPtr;
  1320.  
  1321. struct FWClientInterfaceParamsStruct
  1322. {
  1323.     UInt32                        interfaceSelector;        // Selector indicating the type of request.
  1324.     FWReferenceID                fwReferenceID;            // Reference to target of command.
  1325.     FWClientCommandID            fwClientCommandID;        // ID for this command.
  1326.     UInt32                        fwClientSpecificData;    // Data specific to the FireWire client.
  1327. };
  1328.  
  1329. struct FWClientAsynchRequestParamsStruct
  1330. {
  1331.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1332.     UInt32                        generation;                // Generation number that request was received on.
  1333.     Ptr                            receiveBuffer;            // Pointer to buffer with receive data.
  1334.     Ptr                            transmitBuffer;            // Pointer to buffer with transmit data.
  1335.     UInt16                        sourceID;                // Node ID of source of the request.
  1336.     UInt16                        responseCode;            // Response code.
  1337.     UInt32                        offset;                    // Offset of request within target address space.
  1338.     UInt16                        length;                    // Length of request.
  1339.     UInt16                        extendedTCode;            // Extended transaction code.
  1340.     FWAddressSpaceID            fwAddressSpaceID;        // ID of the target address space.
  1341.     Ptr                            pAddressSpecificData;    // Pointer to data specific to the address space.
  1342. };
  1343. typedef struct FWClientAsynchRequestParamsStruct
  1344.                                 FWClientAsynchRequestParams,
  1345.                                 *FWClientAsynchRequestParamsPtr;
  1346.  
  1347. struct FWClientIsochPortParamsStruct
  1348. {
  1349.     IsochChannelID                isochChannelID;            // Reference to the channel that this port belongs to.
  1350.     UInt32                        refCon;                    // Reference constant for specific port.
  1351.     Boolean                        portIsTalker;            // Boolean indicating that this channel is the talker.
  1352. };
  1353. typedef struct FWClientIsochPortParamsStruct
  1354.                                 FWClientIsochPortParams,
  1355.                                 *FWClientIsochPortParamsPtr;
  1356.  
  1357. struct FWClientInitIsochPortParamsStruct
  1358. {
  1359.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1360.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1361.     UInt32                        channelNum;                // Channel number for port.
  1362.     UInt32                        supportedChannelNumHi,    // Channel numbers supported by port.
  1363.                                 supportedChannelNumLo;
  1364.     UInt32                        speed;                    // Speed of channel.
  1365.     Boolean                        trial;                    // Boolean indicating that this call is just a trial.
  1366. };
  1367. typedef struct FWClientInitIsochPortParamsStruct
  1368.                                 FWClientInitIsochPortParams,
  1369.                                 *FWClientInitIsochPortParamsPtr;
  1370.  
  1371. struct FWClientReleaseIsochPortParamsStruct
  1372. {
  1373.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1374.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1375. };
  1376. typedef struct FWClientReleaseIsochPortParamsStruct
  1377.                                 FWClientReleaseIsochPortParams,
  1378.                                 *FWClientReleaseIsochPortParamsPtr;
  1379.  
  1380. struct FWClientIsochPortControlParamsStruct
  1381. {
  1382.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1383.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1384. };
  1385. typedef struct FWClientIsochPortControlParamsStruct
  1386.                                 FWClientIsochPortControlParams,
  1387.                                 *FWClientIsochPortControlParamsPtr;
  1388.  
  1389.  
  1390. // Define FireWire Client procs.
  1391.  
  1392. typedef OSStatus    (FWClientInterfaceProc) (
  1393.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams,
  1394.     UInt32                        *pCommandAcceptance);
  1395. typedef FWClientInterfaceProc    *FWClientInterfaceProcPtr;
  1396.  
  1397. typedef FWClientInterfaceProc    FWClientResetNotifyProc,
  1398.                                 *FWClientResetNotifyProcPtr;
  1399.  
  1400. typedef OSStatus    (FWClientReadProc) (
  1401.     FWClientAsynchRequestParamsPtr
  1402.                                 pAsynchRequestParams,
  1403.     UInt32                        *pCommandAcceptance);
  1404. typedef FWClientReadProc        *FWClientReadProcPtr;
  1405.  
  1406. typedef OSStatus    (FWClientWriteProc) (
  1407.     FWClientAsynchRequestParamsPtr
  1408.                                 pAsynchRequestParams,
  1409.     UInt32                        *pCommandAcceptance);
  1410. typedef FWClientWriteProc        *FWClientWriteProcPtr;
  1411.  
  1412. typedef OSStatus    (FWClientLockProc) (
  1413.     FWClientAsynchRequestParamsPtr
  1414.                                 pAsynchRequestParams,
  1415.     UInt32                        *pCommandAcceptance);
  1416. typedef FWClientLockProc        *FWClientLockProcPtr;
  1417.  
  1418. typedef OSStatus    (FWClientInitIsochPortProc) (
  1419.     FWClientInitIsochPortParamsPtr
  1420.                                 pInitIsochPortParams,
  1421.     UInt32                        *pCommandAcceptance);
  1422. typedef FWClientInitIsochPortProc
  1423.                                 *FWClientInitIsochPortProcPtr;
  1424.  
  1425. typedef OSStatus    (FWClientReleaseIsochPortProc) (
  1426.     FWClientReleaseIsochPortParamsPtr
  1427.                                 pReleaseIsochPortParams,
  1428.     UInt32                        *pCommandAcceptance);
  1429. typedef FWClientReleaseIsochPortProc
  1430.                                 *FWClientReleaseIsochPortProcPtr;
  1431.  
  1432. typedef OSStatus    (FWClientStartIsochPortProc) (
  1433.     FWClientIsochPortControlParamsPtr
  1434.                                 pIsochPortControlParams,
  1435.     UInt32                        *pCommandAcceptance);
  1436. typedef FWClientStartIsochPortProc
  1437.                                 *FWClientStartIsochPortProcPtr;
  1438.  
  1439. typedef OSStatus    (FWClientStopIsochPortProc) (
  1440.     FWClientIsochPortControlParamsPtr
  1441.                                 pIsochPortControlParams,
  1442.     UInt32                        *pCommandAcceptance);
  1443. typedef FWClientStopIsochPortProc
  1444.                                 *FWClientStopIsochPortProcPtr;
  1445.  
  1446.  
  1447. ////////////////////////////////////////////////////////////////////////////////
  1448. //
  1449. // FWIM defs.
  1450. //
  1451.  
  1452. // Define FWIM command types.
  1453.  
  1454. enum
  1455. {
  1456.     kFWIMSendLinkOnPacket
  1457.                                 = 1,                    // Send a phy configuration packet.
  1458.     kFWIMSendPhyConfigurationPacket
  1459.                                 = 2,                    // Send a phy configuration packet.
  1460.     kFWIMRead                    = 3,                    // Perform a read transaction.
  1461.     kFWIMReadResponse            = 4,                    // Transmit a read response.
  1462.     kFWIMWrite                    = 5,                    // Perform a write transaction.
  1463.     kFWIMWriteResponse            = 6,                    // Transmit a write response.
  1464.     kFWIMLock                    = 7,                    // Perform a lock transaction.
  1465.     kFWIMLockResponse            = 8,                    // Transmit a lock response.
  1466.     kFWIMAllocateIsochPort        = 9,                    // Allocate an isochronous port.
  1467.     kFWIMReleaseIsochPort        = 10,                    // Release resources allocated for an isochronous port.
  1468.     kFWIMStartIsochPort            = 11,                    // Start isochronous port.
  1469.     kFWIMStopIsochPort            = 12,                    // Stop isochronous port.
  1470.     kFWIMResetBus                = 13,                    // Reset the FireWire bus.
  1471.     kFWIMSetContenderBit        = 14,                    // Set the contender bit on the next bus reset.
  1472.     kFWIMClearContenderBit        = 15,                    // Clear the contender bit on the next bus reset.
  1473.     kFWIMEnableCycleMaster        = 16,                    // Enable cycle mastering.
  1474.     kFWIMDisableCycleMaster        = 17,                    // Disable cycle mastering.
  1475.     kFWIMSetRootHoldoffBit        = 18,                    // Set the root holdoff bit.
  1476.     kFWIMClearRootHoldoffBit    = 19,                    // Clear the root holdoff bit.
  1477.     kFWIMGetUniqueID            = 20                    // Get the local unique ID.
  1478. };
  1479.  
  1480.  
  1481. // Defs for calls from the FWIM interface.
  1482.  
  1483. enum
  1484. {
  1485.     kFWIMProcessSelfIDs            = 1,
  1486.     kFWIMProcessRead            = 2,
  1487.     kFWIMProcessWrite            = 3,
  1488.     kFWIMProcessLock            = 4
  1489. };
  1490.  
  1491. // Defs for calls to the FWIM interface.
  1492. //zzz some of this stuff should be private
  1493.  
  1494. enum
  1495. {
  1496.     kFWIMCommandSyncFlag        = (1 << 0),                // Perform FWIM command synchronously.
  1497.     kFWIMCommandPriorityFlag    = (1 << 1),                // This is a priority command.
  1498.     kFWIMCommandImmediateFlag    = (1 << 2)                // Perform FWIM command immediately.
  1499. };
  1500.  
  1501. enum
  1502. {
  1503.     kFWIMCommandQueueActiveBit    = 0,
  1504.     kFWIMCommandQueueActiveByte    = 1,
  1505.     kFWIMCommandQueueActive        = (1 << kFWIMCommandQueueActiveBit),
  1506.  
  1507.     kFWIMCommandQueueDisabledBit    = 1,
  1508.     kFWIMCommandQueueDisabledByte    = 1,
  1509.     kFWIMCommandQueueDisabled        = (1 << kFWIMCommandQueueDisabledBit)
  1510. };
  1511.  
  1512. enum
  1513. {
  1514.     kFWIMCommandBusy            = 1
  1515. };
  1516.  
  1517. enum
  1518. {
  1519.     kFWIMCommandAcceptNoMore    = 0,
  1520.     kFWIMCommandAcceptMore        = 1,
  1521.     kFWIMCommandRejected        = 2
  1522. };
  1523.  
  1524. typedef struct FWIMCommandParamsStruct
  1525.                                 FWIMCommandParams,
  1526.                                 *FWIMCommandParamsPtr;
  1527.  
  1528. typedef void    (FWIMCommandCompletionProc) (
  1529.     FWIMCommandParamsPtr        pFWIMCommandParams);
  1530. typedef FWIMCommandCompletionProc
  1531.                                 *FWIMCommandCompletionProcPtr;
  1532.  
  1533. struct FWIMInitializeParamsStruct
  1534. {
  1535.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1536.     FWIMID                        fwimID;                    // ID for this FWIM
  1537.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1538. };
  1539. typedef struct FWIMInitializeParamsStruct
  1540.                                 FWIMInitializeParams,
  1541.                                 *FWIMInitializeParamsPtr;
  1542.  
  1543. struct FWIMFinalizeParamsStruct
  1544. {
  1545.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1546.     FWIMID                        fwimID;                    // ID for this FWIM
  1547.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1548. };
  1549. typedef struct FWIMFinalizeParamsStruct
  1550.                                 FWIMFinalizeParams,
  1551.                                 *FWIMFinalizeParamsPtr;
  1552.  
  1553. struct FWIMPollInterruptsParamsStruct
  1554. {
  1555.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1556.     FWIMID                        fwimID;                    // ID for this FWIM
  1557. };
  1558. typedef struct FWIMPollInterruptsParamsStruct
  1559.                                 FWIMPollInterruptsParams,
  1560.                                 *FWIMPollInterruptsParamsPtr;
  1561.  
  1562. struct FWIMCommandParamsStruct
  1563. {
  1564.     UInt32                        commandType;            // Type of command.
  1565.     FWIMID                        fwimID;                    // Reference to target FWIM.
  1566.     UInt32                        fwimSpecificData;        // Data specific to FWIM.
  1567.     FWIMCommandID                fwimCommandID;            // ID for this command.
  1568. };
  1569.  
  1570. struct FWIMGetUniqueIDParamsStruct
  1571. {
  1572.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1573.     CSRNodeUniqueID                uniqueID;                // Local unique ID.
  1574. };
  1575. typedef struct FWIMGetUniqueIDParamsStruct
  1576.                                 FWIMGetUniqueIDParams,
  1577.                                 *FWIMGetUniqueIDParamsPtr;
  1578.  
  1579. struct FWIMSendPhyPacketParamsStruct
  1580. {
  1581.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1582.     UInt32                        generation;                // FireWire bus generation number.
  1583.     Ptr                            buffer;                    // Buffer with phy packet data.
  1584.     UInt32                        length;                    // Length of packet data.
  1585.     UInt32                        commandStorage;            // Most common phy packets only need 4 bytes.
  1586. };
  1587. typedef struct FWIMSendPhyPacketParamsStruct
  1588.                                 FWIMSendPhyPacketParams,
  1589.                                 *FWIMSendPhyPacketParamsPtr;
  1590.  
  1591. struct FWIMAsynchCommandParamsStruct
  1592. {
  1593.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1594.     Duration                    timeout;                // Split transaction timeout.
  1595.     UInt32                        generation;                // FireWire bus generation number.
  1596.     Ptr                            buffer;                    // Local buffer to read/write into/from
  1597.     UInt8                        numRetries;                // Number of retries left.
  1598.     UInt8                        speed;                    // Transmission speed.
  1599.     UInt16                        reserved;
  1600.     UInt32                        addressHi,
  1601.                                 addressLo;                // FireWire bus address to read/write from/to
  1602.     UInt16                        length;                    // Length of read/write
  1603.     UInt16                        extendedTCode;            // Extended transaction code.
  1604. };
  1605. typedef struct FWIMAsynchCommandParamsStruct
  1606.                                 FWIMAsynchCommandParams,
  1607.                                 *FWIMAsynchCommandParamsPtr;
  1608.  
  1609. enum
  1610. {
  1611.     kFWTransactionDescriptorTLabel        = FWBitRange (16, 21),
  1612.     kFWTransactionDescriptorTLabelPhase    = FWBitRangePhase (16, 21)
  1613. };
  1614.  
  1615. enum //zzz need FWBitRange16
  1616. {
  1617.     kFWResponseDataRCode        = FWBitRange (16, 19),
  1618.     kFWResponseDataRCodePhase    = FWBitRangePhase (16, 19)
  1619. };
  1620.  
  1621. struct FWIMAsynchResponseCommandParamsStruct
  1622. {
  1623.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1624.     AbsoluteTime                timeout;                // Timeout for this response.
  1625.     UInt32                        generation;                // Topology map generation number this response is valid for.
  1626.     Ptr                            buffer;                    // Response buffer.
  1627.     UInt8                        numRetries;                // Number of retries left.
  1628.     UInt8                        speed;                    // Transmission speed.
  1629.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  1630.     UInt16                        destinationID;            // Destination node ID for this response.
  1631.     UInt16                        responseDataHi;            // Response data for transaction.
  1632.     UInt32                        responseDataLo;
  1633.     UInt16                        length;                    // Length of response data.
  1634.     UInt16                        extendedTCode;            // Extended transaction code for this response.
  1635. };
  1636. typedef struct FWIMAsynchResponseCommandParamsStruct
  1637.                                 FWIMAsynchResponseCommandParams,
  1638.                                 *FWIMAsynchResponseCommandParamsPtr;
  1639.  
  1640. struct FWIMIsochPortCommandParamsStruct
  1641. {
  1642.     IsochPortID                    isochPortID;            // Isochronous port ID.
  1643.     UInt32                        fwimIsochPortData;        // Data for FWIM to use for this isoch port.
  1644. };
  1645. typedef struct FWIMIsochPortCommandParamsStruct
  1646.                                 FWIMIsochPortCommandParams,
  1647.                                 *FWIMIsochPortCommandParamsPtr;
  1648.  
  1649. struct FWIMAllocateIsochPortParamsStruct
  1650. {
  1651.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1652.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1653.     DCLProgramID                dclProgramID;            // DCL program for this port.
  1654.     UInt32                        channelNum;                // Isochronous channel number.
  1655.     UInt32                        speed;                    // Speed to use for channel.
  1656.     Boolean                        talking;                // Buffer is for talking (listening if false).
  1657. };
  1658. typedef struct FWIMAllocateIsochPortParamsStruct
  1659.                                 FWIMAllocateIsochPortParams,
  1660.                                 *FWIMAllocateIsochPortParamsPtr;
  1661.  
  1662. struct FWIMReleaseIsochPortParamsStruct
  1663. {
  1664.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1665.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1666. };
  1667. typedef struct FWIMReleaseIsochPortParamsStruct
  1668.                                 FWIMReleaseIsochPortParams,
  1669.                                 *FWIMReleaseIsochPortParamsPtr;
  1670.  
  1671. struct FWIMIsochPortControlParamsStruct
  1672. {
  1673.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1674.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1675. };
  1676. typedef struct FWIMIsochPortControlParamsStruct
  1677.                                 FWIMIsochPortControlParams,
  1678.                                 *FWIMIsochPortControlParamsPtr;
  1679.  
  1680. // Define FWIM plug in dispatch table.
  1681.  
  1682. typedef OSStatus (FWIMInitializeProc) (
  1683.     FWIMInitializeParamsPtr        pFWIMInitializeParams);
  1684. typedef FWIMInitializeProc        *FWIMInitializeProcPtr;
  1685.  
  1686. typedef OSStatus (FWIMFinalizeProc) (
  1687.     FWIMFinalizeParamsPtr        pFWIMFinalizeParams);
  1688. typedef FWIMFinalizeProc        *FWIMFinalizeProcPtr;
  1689.  
  1690. typedef OSStatus (FWIMPollInterruptsProc) (
  1691.     FWIMPollInterruptsParamsPtr    pFWIMPollInterruptsParams);
  1692. typedef FWIMPollInterruptsProc    *FWIMPollInterruptsProcPtr;
  1693.  
  1694. typedef OSStatus (FWIMCommandProc) (
  1695.     FWIMCommandParamsPtr        pFWIMCommandParams,
  1696.     UInt32                        *pCommandAcceptance);
  1697. typedef FWIMCommandProc            *FWIMCommandProcPtr;
  1698.  
  1699. typedef OSStatus (FWIMSendPhyPacketProc) (
  1700.     FWIMSendPhyPacketParamsPtr    pFWIMSendPhyPacketParams,
  1701.     UInt32                        *pCommandAcceptance);
  1702. typedef FWIMSendPhyPacketProc    *FWIMSendPhyPacketProcPtr;
  1703.  
  1704. typedef OSStatus (FWIMAsynchTransactionProc) (
  1705.     FWIMAsynchCommandParamsPtr    pFWIMAsynchCommandParams,
  1706.     UInt32                        *pCommandAcceptance);
  1707. typedef FWIMAsynchTransactionProc
  1708.                                 *FWIMAsynchTransactionProcPtr;
  1709.  
  1710. typedef OSStatus (FWIMSendAsynchResponsePacketProc) (
  1711.     FWIMAsynchResponseCommandParamsPtr
  1712.                                 pFWIMAsynchResponseCommandParams,
  1713.     UInt32                        *pCommandAcceptance);
  1714. typedef FWIMSendAsynchResponsePacketProc
  1715.                                 *FWIMSendAsynchResponsePacketProcPtr;
  1716.  
  1717. typedef OSStatus (FWIMAllocateIsochPortProc) (
  1718.     FWIMAllocateIsochPortParamsPtr
  1719.                                 pFWIMAllocateIsochPortParams,
  1720.     UInt32                        *pCommandAcceptance);
  1721. typedef FWIMAllocateIsochPortProc
  1722.                                 *FWIMAllocateIsochPortProcPtr;
  1723.  
  1724. typedef OSStatus (FWIMReleaseIsochPortProc) (
  1725.     FWIMReleaseIsochPortParamsPtr
  1726.                                 pFWIMReleaseIsochPortParams,
  1727.     UInt32                        *pCommandAcceptance);
  1728. typedef FWIMReleaseIsochPortProc
  1729.                                 *FWIMReleaseIsochPortProcPtr;
  1730.  
  1731. typedef OSStatus (FWIMControlIsochPortProc) (
  1732.     FWIMIsochPortControlParamsPtr
  1733.                                 pFWIMIsochPortControlParams,
  1734.     UInt32                        *pCommandAcceptance);
  1735. typedef FWIMControlIsochPortProc
  1736.                                 *FWIMControlIsochPortProcPtr;
  1737.  
  1738. typedef OSStatus (FWIMGetUniqueIDProc) (
  1739.     FWIMGetUniqueIDParamsPtr    pFWIMGetUniqueIDParams,
  1740.     UInt32                        *pCommandAcceptance);
  1741. typedef FWIMGetUniqueIDProc        *FWIMGetUniqueIDProcPtr;
  1742.  
  1743. enum
  1744. {
  1745.     kFWIMPluginVersion            = 0x00010000
  1746. };
  1747.  
  1748. struct FWIMPluginDispatchTableStruct
  1749. {
  1750.     UInt32                        pluginVersion;
  1751.     FWIMInitializeProcPtr        fwimInitializeProc;        // Proc that initializes the FWIM.
  1752.     FWIMFinalizeProcPtr            fwimFinalizeProc;        // Proc that finalizes the FWIM.
  1753.     FWIMPollInterruptsProcPtr    fwimPollInterruptsProcPtr;    // Proc that polls for interrupts.
  1754.     FWIMSendPhyPacketProcPtr    fwimSendLinkOnPacketProc;    // Proc that sends a link on packet.
  1755.     FWIMSendPhyPacketProcPtr    fwimSendPhyConfigurationPacketProc;    // Proc that sends a phy configuration packet.
  1756.     FWIMAsynchTransactionProcPtr
  1757.                                 fwimReadProc;            // Proc that performs an asynchronous read transaction.
  1758.     FWIMSendAsynchResponsePacketProcPtr
  1759.                                 fwimReadResponseProc;    // Proc that sends an asynchronous read response packet.
  1760.     FWIMAsynchTransactionProcPtr
  1761.                                 fwimWriteProc;            // Proc that performs an asynchronous write transaction.
  1762.     FWIMSendAsynchResponsePacketProcPtr
  1763.                                 fwimWriteResponseProc;    // Proc that sends an asynchronous write response packet.
  1764.     FWIMAsynchTransactionProcPtr
  1765.                                 fwimLockProc;            // Proc that performs an asynchronous lock transaction.
  1766.     FWIMSendAsynchResponsePacketProcPtr
  1767.                                 fwimLockResponseProc;    // Proc that sends an asynchronous lock response packet.
  1768.     FWIMAllocateIsochPortProcPtr
  1769.                                 fwimAllocateIsochPortProc;    // Proc that allocates an isochronous port.
  1770.     FWIMReleaseIsochPortProcPtr    fwimReleaseIsochPortProc;    // Proc that releases an isochronous port.
  1771.     FWIMControlIsochPortProcPtr    fwimStartIsochPortProc;    // Proc that starts an isochronous port.
  1772.     FWIMControlIsochPortProcPtr    fwimStopIsochPortProc;    // Proc that stops an isochronous port.
  1773.     FWIMCommandProcPtr            fwimResetBusProc;        // Proc that initiates a FireWire bus reset.
  1774.     FWIMCommandProcPtr            fwimSetContenderBitProc;    // Proc that sets the contender bit.
  1775.     FWIMCommandProcPtr            fwimClearContenderBitProc;    // Proc that clears the contender bit.
  1776.     FWIMCommandProcPtr            fwimEnableCycleMasterProc;    // Proc that enables cycle mastering.
  1777.     FWIMCommandProcPtr            fwimDisableCycleMasterProc;    // Proc that disables cycle mastering.
  1778.     FWIMCommandProcPtr            fwimSetRootHoldoffBitProc;    // Proc that sets the root holdoff bit.
  1779.     FWIMCommandProcPtr            fwimClearRootHoldoffBitProc;    // Proc that clears the root holdoff bit.
  1780.     FWIMGetUniqueIDProcPtr        fwimGetUniqueIDProc;    // Proc that returns local unique ID.
  1781. };
  1782. typedef struct FWIMPluginDispatchTableStruct
  1783.                                 FWIMPluginDispatchTable,
  1784.                                 *FWIMPluginDispatchTablePtr;
  1785.  
  1786. typedef struct FWIMProcessParamsStruct
  1787.                                 FWIMProcessParams,
  1788.                                 *FWIMProcessParamsPtr;
  1789.  
  1790. typedef void    (FWIMProcessCompletionProc) (
  1791.     FWIMProcessParamsPtr        pFWIMProcessParams);
  1792. typedef FWIMProcessCompletionProc
  1793.                                 *FWIMProcessCompletionProcPtr;
  1794.  
  1795. struct FWIMProcessParamsStruct
  1796. {
  1797.     FWIMProcessParamsPtr        pNextFWIMProcessParams;    // Link to next set of params.
  1798.     UInt32                        processType;            // Type of processing.
  1799.     FWIMID                        fwimID;                    // Reference to calling FWIM.
  1800.     UInt32                        processFlags;            // Flag bits to control processing.
  1801.     UInt32                        processState;            // State bits of processing.
  1802.     UInt32                        processStatus;            // Final status of processing.
  1803.     FWIMProcessID                fwimProcessID;            // ID for this process.
  1804.     FWIMProcessCompletionProcPtr
  1805.                                 completionProc;            // Proc to call upon completion of processing.
  1806.     UInt32                        completionProcData;        // Data provided and used by caller.
  1807. };
  1808.  
  1809. struct FWIMProcessSelfIDsParamsStruct
  1810. {
  1811.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  1812.     UInt32                        generation;                // Bus generation of these self IDs.
  1813.     Ptr                            pSelfIDList;            // List of self IDs.
  1814.     UInt32                        selfIDListSize;            // Size of above list in bytes.
  1815.     Ptr                            pLocalSelfID;            // Local self ID if not included in above list.
  1816.     UInt32                        localSelfIDSize;        // Size of local self ID.
  1817.     UInt32                        processSelfIDsFlags;    // Flags controlling self ID processing.
  1818. };
  1819. typedef struct FWIMProcessSelfIDsParamsStruct
  1820.                                 FWIMProcessSelfIDsParams,
  1821.                                 *FWIMProcessSelfIDsParamsPtr;
  1822.  
  1823. enum
  1824. {
  1825.     kFWTransactionStatusAckCode            = FWBitRange (28, 31),
  1826.     kFWTransactionStatusAckCodePhase    = FWBitRangePhase (28, 31),
  1827.     kFWTransactionStatusSpeed            = FWBitRange (26, 27),
  1828.     kFWTransactionStatusSpeedPhase        = FWBitRangePhase (26, 27)
  1829. };
  1830.  
  1831. struct FWIMProcessAsynchParamsStruct
  1832. {
  1833.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  1834.     AbsoluteTime                timeStamp;                // Time stamp marking arrival time of packet.
  1835.     UInt32                        generation;                // Topology map generation number when packet was received.
  1836.     Ptr                            receiveBuffer;            // Buffer for data that we receive.
  1837.     UInt16                        destinationID;            // ID of destination node.
  1838.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  1839.     UInt16                        sourceID;                // ID of source node.
  1840.     UInt16                        addressHi;                // Destination address.
  1841.     UInt32                        addressLo;
  1842.     UInt16                        length;                    // Length of transaction.
  1843.     UInt16                        extendedTCode;            // Extended transaction code.
  1844.     UInt32                        transactionStatus;        // Status of transaction.
  1845. };
  1846. typedef struct FWIMProcessAsynchParamsStruct
  1847.                                 FWIMProcessAsynchParams,
  1848.                                 *FWIMProcessAsynchParamsPtr;
  1849.  
  1850.  
  1851. ////////////////////////////////////////////////////////////////////////////////
  1852. //
  1853. // FireWire virtual device defs.
  1854. //
  1855.  
  1856. /*zzz should be in VirtualDevice.h */
  1857. //zzz support multiple bus vdev??? (FW and SCSI vdev?)
  1858. //
  1859.  
  1860. enum
  1861. {
  1862.     kVDeviceDescriptionSignature
  1863.                                 = 'vdei'                // Virtual Device Export Information
  1864. };
  1865.  
  1866. enum
  1867. {
  1868.     kVDeviceDescriptionVersion    = 0x00010000
  1869. };
  1870.  
  1871. struct VDeviceDescriptionStruct
  1872. {
  1873.     OSType                        vDeviceDescSignature;    // Virtual Device Description signature.
  1874.     UInt32                        vDeviceDescVersion;        // Virtual Device Description version.
  1875.     UInt32                        vDeviceDescSize;        // Total size of this description.
  1876.     OSType                        vDeviceServiceCategory;    // Service category of family providing interface to this
  1877.                                                         // virtual device.
  1878. };
  1879. typedef struct VDeviceDescriptionStruct
  1880.                                 VDeviceDescription,
  1881.                                 *VDeviceDescriptionPtr;
  1882.  
  1883. struct FWVDeviceDescriptionStruct
  1884. {
  1885.     VDeviceDescription            vDeviceDescription;        // Universal Virtual Device description.
  1886.     UInt32                        unitSpecID;                // Unit Spec ID to present in unit directory (24-bit).
  1887.     UInt32                        unitSWVersion;            // Unit SW version to present in unit directory (24-bit).
  1888. };
  1889. typedef struct FWVDeviceDescriptionStruct
  1890.                                 FWVDeviceDescription,
  1891.                                 *FWVDeviceDescriptionPtr;
  1892.  
  1893. /*zzz*/
  1894.  
  1895. // Define FW virtual device proc names.
  1896. #define FWVDeviceInstallProcPascalName "\pFWVDeviceInstall"
  1897. #define FWVDeviceInterfaceProcPascalName "\pFWVDeviceInterface"
  1898.  
  1899. struct FWVDeviceInstallParamsStruct
  1900. {
  1901.     Ptr                            fwVDeviceSpecificData;    // Data specific to virtual device.
  1902.     FWVDeviceID                    fwVDeviceID;            // ID for this virtual device.
  1903.     CSRROMEntryID                fwVDeviceCSRROMUnitDirID;    // ID of the virtual device's CSR ROM unit directory.
  1904. };
  1905. typedef struct FWVDeviceInstallParamsStruct
  1906.                                 FWVDeviceInstallParams,
  1907.                                 *FWVDeviceInstallParamsPtr;
  1908.  
  1909. typedef OSStatus
  1910.     (FWVDeviceInstallProc) (
  1911.         FWVDeviceInstallParamsPtr    pFWVDeviceInstallParams);
  1912. typedef FWVDeviceInstallProc    *FWVDeviceInstallProcPtr;
  1913.  
  1914.  
  1915. ////////////////////////////////////////////////////////////////////////////////
  1916. //
  1917. // FireWire protocol driver defs.
  1918. //
  1919.  
  1920. enum
  1921. {
  1922.     kFWPDriverFileType            = 'ndrv'
  1923. };
  1924.  
  1925. enum
  1926. {
  1927.     kTheFWPDriverDescriptionSignature
  1928.                                 = 'pdei'
  1929. };
  1930.  
  1931. enum
  1932. {
  1933.     kInitialFWPDriverDescriptor    = 0
  1934. };
  1935.  
  1936. typedef UInt32    FWPDriverDescVersion;
  1937. typedef OptionBits    FWPDriverLoadingOptions;
  1938.  
  1939. typedef OSStatus    (FWPDriverUnitAddedProc) (
  1940.     FWPDriverID                    fwPDriverID,
  1941.     UInt32                        fwPDriverSpecificData,
  1942.     FWUnitID                    fwUnitID);
  1943. typedef FWPDriverUnitAddedProc
  1944.                                 *FWPDriverUnitAddedProcPtr;
  1945.  
  1946. typedef OSStatus    (FWPDriverUnitRemovedProc) (
  1947.     FWPDriverID                    fwPDriverID,
  1948.     UInt32                        fwPDriverSpecificData,
  1949.     FWUnitID                    fwUnitID);
  1950. typedef FWPDriverUnitRemovedProc
  1951.                                 *FWPDriverUnitRemovedProcPtr;
  1952.  
  1953. struct FWPDriverProtocolStruct
  1954. {
  1955.     UInt32                        specID;                    // IDs specifying protocol.
  1956.     UInt32                        swVersion;
  1957. };
  1958. typedef struct FWPDriverProtocolStruct
  1959.                                 FWPDriverProtocol,
  1960.                                 *FWPDriverProtocolPtr;
  1961.  
  1962. struct FWPDriverTypeStruct
  1963. {
  1964.     OSType                        fwPDriverServiceCategory;    // Service category that this protocol driver communicates over.
  1965.     NumVersion                    fwPDriverVersion;            // Protocol driver version number.
  1966. };
  1967. typedef struct FWPDriverTypeStruct
  1968.                                 FWPDriverType,
  1969.                                 *FWPDriverTypePtr;
  1970.  
  1971. struct FWPDriverLoadingInfoStruct
  1972. {
  1973.     FWPDriverLoadingOptions        fwPDriverLoadingOptions;    // Options for protocol driver loading.
  1974.     Str31                        fwPDriverName;            // Protocol driver's name when loading into the Name Registry.
  1975. };
  1976. typedef struct FWPDriverLoadingInfoStruct
  1977.                                 FWPDriverLoadingInfo,
  1978.                                 *FWPDriverLoadingInfoPtr;
  1979.  
  1980. struct FWPDriverDescriptionStruct
  1981. {
  1982.     OSType                        fwPDriverDescSignature;    // Signature field of this structure.
  1983.     FWPDriverDescVersion        fwPDriverDescVersion;    // Version of this data structure.
  1984.     FWPDriverType                fwPDriverType;            // Type of protocol driver.
  1985.     FWPDriverLoadingInfo        fwPDriverLoadingInfo;    // Loading information for protocol driver.
  1986. };
  1987. typedef struct FWPDriverDescriptionStruct
  1988.                                 FWPDriverDescription,
  1989.                                 *FWPDriverDescriptionPtr;
  1990.  
  1991.  
  1992. ////////////////////////////////////////////////////////////////////////////////
  1993. //
  1994. // FireWire Services defs.
  1995. //
  1996.  
  1997. // FireWire Services constants.
  1998.  
  1999. enum
  2000. {
  2001.     kFWCommandWaiting            = 1,
  2002.     kFWCommandBusy                = 2,
  2003.     kFWCommandComplete            = 3
  2004. };
  2005.  
  2006. enum
  2007. {
  2008.     kFWCommandSyncFlag            = (1 << 0),                // Perform command synchronously.
  2009.     kFWCommandPriorityFlag        = (1 << 1),                // This is a priority command.
  2010.     kFWCommandSynchronizeFlag    = (1 << 2),                // Wait for this command to complete before starting
  2011.                                                         // subsequent commands.
  2012.     kFWCommandImmediateFlag        = (1 << 3)                // Perform command immediately.
  2013. };
  2014.  
  2015. enum
  2016. {
  2017.     kInvalidFWNodeID            = 0x7FFFFFFF,
  2018.     kInvalidFWGenerationNumber    = 0x7FFFFFFF
  2019. };
  2020.  
  2021. enum
  2022. {
  2023.     kIsochChannelActiveBit        = (1 << 0),                // Isochronous channel is active.
  2024.     kIsochChannelInitializedBit    = (1 << 1),                // Isochronous channel has been initialized.
  2025.     kIsochChannelBandwidthAllocatedBit    = (1 << 2),        // Bandwidth has been allocated for isochronous channel.
  2026.     kIsochChannelChannelAllocatedBit    = (1 << 3),        // Channel number has been allocated for isochronous channel.
  2027.     kIsochChannelAllocateOnResetBit        = (1 << 4)        // Resources must be reallocated on bus reset.
  2028. };
  2029.  
  2030. enum
  2031. {
  2032.     kInvalidFWChannelNum        = 0x7FFFFFFF
  2033. };
  2034.  
  2035.  
  2036. // Define FireWire service interface selectors.
  2037.  
  2038. enum
  2039. {
  2040.     kFWRead                        = 1,                    // Perform a read across the bus.
  2041.     kFWWrite                    = 2,                    // Perform a write across the bus.
  2042.     kFWCompareAndSwap            = 3,                    // Perform a write across the bus.
  2043.     kFWSendFCPCommand            = 4,                    // Send an FCP command and wait for response.
  2044.     kFWResetBus                    = 5,                    // Reset the FireWire bus.
  2045.     kFWBitAnd                    = 6,                    // Perform an atomic bitwise and.
  2046.     kFWBitOr                    = 7,                    // Perform an atomic bitwise or.
  2047.     kFWBitXor                    = 8,                    // Perform an atomic bitwise xor.
  2048.     kFWIncrement                = 9,                    // Perform an atomic increment.
  2049.     kFWDecrement                = 10,                    // Perform an atomic decrement.
  2050.     kFWAdd                        = 11,                    // Perform an atomic add.
  2051.     kFWThresholdAdd                = 12,                    // Perform an atomic threshold add.
  2052.     kFWThresholdSubtract        = 13,                    // Perform an atomic threshold subtract.
  2053.     kFWClippedAdd                = 14,                    // Perform an atomic clipped add.
  2054.     kFWClippedSubtract            = 15,                    // Perform an atomic clipped subtract.
  2055.     kFWInitializeIsochronousChannel    = 16,                // Initialize an isochronous channel.
  2056.     kFWReleaseIsochronousChannel    = 17,                // Release an isochronous channel.
  2057.     kFWStartIsochronousChannel        = 18,                // Start an isochronous channel.
  2058.     kFWStopIsochronousChannel        = 19,                // Stop an isochronous channel.
  2059.     kFWAllocateLocalIsochronousPort    = 20,                // Allocate a local isochronous port.
  2060.     kFWReleaseLocalIsochronousPort    = 21,                // Release a local isochronous port.
  2061.     kFWStartLocalIsochronousPort    = 22,                // Start a local isochronous port.
  2062.     kFWStopLocalIsochronousPort        = 23                // Stop a local isochronous port.
  2063. };
  2064.  
  2065. enum
  2066. {
  2067.     kFWBasicCommandObjectType            = 1,            // Type of FireWire command object for basic commands.
  2068.     kFWAsynchCommandObjectType            = 2,            // Type of FireWire command object for asynchronous transaction commands.
  2069.     kFWIsochChannelCommandObjectType    = 3,            // Type of FireWire command object for isoch channel commands.
  2070.     kFWIsochPortCommandObjectType        = 4,            // Type of FireWire command object for isoch port commands.
  2071.     kFWFCPCommandObjectType                = 5                // Type of FireWire command object for FCP commands.
  2072. };
  2073.  
  2074. enum
  2075. {
  2076.     kFWAsynchOverrideMaxPayload    = (1 << 0),                // Override max payload transfer flag.
  2077.     kFWAsynchDisableAddressIncrement
  2078.                                 = (1 << 1),                // Disable auto incrementing of target addresses.
  2079.     kFWAsynchAbsoluteAddress    = (1 << 2),                // Use full 64-bit address.
  2080.     kFWAsynchFailOnBusReset        = (1 << 3)                // Fail asynchronous command if a bus reset occurs.
  2081. };
  2082.  
  2083. // FireWire service request type defs.
  2084.  
  2085. typedef void    (FWCommandCompletionProc) (
  2086.     FWCommandObjectID            fwCommandObjectID,
  2087.     OSStatus                    commandStatus,
  2088.     UInt32                        completionProcData);
  2089. typedef FWCommandCompletionProc    *FWCommandCompletionProcPtr;
  2090.  
  2091. enum
  2092. {
  2093.     kResponseDoneStatus            = 0,
  2094.     kResponseContinueStatus        = 1,
  2095.     kResponseUnrecognizedStatus    = 2
  2096. };
  2097.  
  2098. typedef UInt32    (FCPResponseHandler) (
  2099.     FWCommandObjectID            fwCommandObjectID,
  2100.     Ptr                            responseBuffer,
  2101.     UInt32                        responseLength);
  2102. typedef FCPResponseHandler        *FCPResponseHandlerPtr;
  2103.  
  2104. struct FWAddressStruct
  2105. {
  2106.     UInt32                        addressHi,
  2107.                                 addressLo;
  2108. };
  2109. typedef struct FWAddressStruct    FWAddress, *FWAddressPtr;
  2110.  
  2111.  
  2112. // FireWire Services procedure defs.
  2113.  
  2114. OSStatus    FWRegisterDriver (
  2115.     RegEntryIDPtr                pFWDriverRegEntry,
  2116.     FWDriverID                    *pFWDriverID,
  2117.     CSRROMEntryID                *pCSRUnitID,
  2118.     UInt32                        fwDriverSpecificData);
  2119.  
  2120. OSStatus    FWUnregisterDriver (
  2121.     FWDriverID                    fwDriverID);
  2122.  
  2123. OSStatus    FWRegisterProtocolDriver (
  2124.     RegEntryIDPtr                pFWPDriverRegEntry,
  2125.     FWPDriverID                    *pFWPDriverID,
  2126.     UInt32                        fwPDriverSpecificData);
  2127.  
  2128. OSStatus    FWUnregisterProtocolDriver (
  2129.     FWPDriverID                    fwPDriverID);
  2130.  
  2131. OSStatus    FWScanUnitsForFWPDriver (
  2132.     FWPDriverID                    fwPDriverID);
  2133.  
  2134. OSStatus    FWSetPDriverProtocolTable (
  2135.     FWPDriverID                    fwPDriverID,
  2136.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2137.     UInt32                        tableSize);
  2138.  
  2139. OSStatus    FWGetPDriverProtocolTable (
  2140.     FWPDriverID                    fwPDriverID,
  2141.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2142.     UInt32                        *pTableSize,
  2143.     UInt32                        maxTableSize);
  2144.  
  2145. OSStatus    FWSetFWPDriverUnitAddedProc (
  2146.     FWPDriverID                    fwPDriverID,
  2147.     FWPDriverUnitAddedProcPtr    fwPDriverUnitAddedProc);
  2148.  
  2149. OSStatus    FWGetFWPDriverUnitAddedProc (
  2150.     FWPDriverID                    fwPDriverID,
  2151.     FWPDriverUnitAddedProcPtr    *pFWPDriverUnitAddedProc);
  2152.  
  2153. OSStatus    FWSetFWPDriverUnitRemovedProc (
  2154.     FWPDriverID                    fwPDriverID,
  2155.     FWPDriverUnitRemovedProcPtr    fwPDriverUnitRemovedProc);
  2156.  
  2157. OSStatus    FWGetFWPDriverUnitRemovedProc (
  2158.     FWPDriverID                    fwPDriverID,
  2159.     FWPDriverUnitRemovedProcPtr    *pFWPDriverUnitRemovedProc);
  2160.  
  2161. OSStatus    FWRegisterFSSpecPDriver (
  2162.     FSSpecPtr                    pFWPDriverFSSpec);
  2163.  
  2164. OSStatus    FWRegisterFSSpecResourcePDriver (
  2165.     FSSpecPtr                    pFWPDriverFSSpec,
  2166.     ResType                        fwPDriverResType,
  2167.     short                        fwPDriverResID);
  2168.  
  2169. OSStatus    FWAddUnitConnection (
  2170.     FWUnitID                    fwUnitID,
  2171.     FWReferenceID                fwReferenceID);
  2172.  
  2173. OSStatus    FWRemoveUnitConnection (
  2174.     FWUnitID                    fwUnitID,
  2175.     FWReferenceID                fwReferenceID);
  2176.  
  2177. OSStatus    FWSetFWClientResetNotifyProc (
  2178.     FWReferenceID                fwReferenceID,
  2179.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2180.  
  2181. OSStatus    FWGetFWClientResetNotifyProc (
  2182.     FWReferenceID                fwReferenceID,
  2183.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2184.  
  2185. OSStatus    FWSetFWClientBusManagementNotifyProc (
  2186.     FWReferenceID                fwReferenceID,
  2187.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2188.  
  2189. OSStatus    FWGetFWClientBusManagementNotifyProc (
  2190.     FWReferenceID                fwReferenceID,
  2191.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2192.  
  2193. OSStatus    FWSetFWClientReadRequestProc (
  2194.     FWReferenceID                fwReferenceID,
  2195.     FWClientReadProcPtr            fwClientReadRequestProc);
  2196.  
  2197. OSStatus    FWGetFWClientReadRequestProc (
  2198.     FWReferenceID                fwReferenceID,
  2199.     FWClientReadProcPtr            *pFWClientReadRequestProc);
  2200.  
  2201. OSStatus    FWSetFWClientReadCompleteProc (
  2202.     FWReferenceID                fwReferenceID,
  2203.     FWClientReadProcPtr            fwClientReadCompleteProc);
  2204.  
  2205. OSStatus    FWGetFWClientReadCompleteProc (
  2206.     FWReferenceID                fwReferenceID,
  2207.     FWClientReadProcPtr            *pFWClientReadCompleteProc);
  2208.  
  2209. OSStatus    FWSetFWClientWriteRequestProc (
  2210.     FWReferenceID                fwReferenceID,
  2211.     FWClientWriteProcPtr        fwClientWriteRequestProc);
  2212.  
  2213. OSStatus    FWGetFWClientWriteRequestProc (
  2214.     FWReferenceID                fwReferenceID,
  2215.     FWClientWriteProcPtr        *pFWClientWriteRequestProc);
  2216.  
  2217. OSStatus    FWSetFWClientWriteCompleteProc (
  2218.     FWReferenceID                fwReferenceID,
  2219.     FWClientWriteProcPtr        fwClientWriteCompleteProc);
  2220.  
  2221. OSStatus    FWGetFWClientWriteCompleteProc (
  2222.     FWReferenceID                fwReferenceID,
  2223.     FWClientWriteProcPtr        *pFWClientWriteCompleteProc);
  2224.  
  2225. OSStatus    FWSetFWClientLockRequestProc (
  2226.     FWReferenceID                fwReferenceID,
  2227.     FWClientLockProcPtr            fwClientLockRequestProc);
  2228.  
  2229. OSStatus    FWGetFWClientLockRequestProc (
  2230.     FWReferenceID                fwReferenceID,
  2231.     FWClientLockProcPtr            *pFWClientLockRequestProc);
  2232.  
  2233. OSStatus    FWSetFWClientLockCompleteProc (
  2234.     FWReferenceID                fwReferenceID,
  2235.     FWClientLockProcPtr            fwClientLockCompleteProc);
  2236.  
  2237. OSStatus    FWGetFWClientLockCompleteProc (
  2238.     FWReferenceID                fwReferenceID,
  2239.     FWClientLockProcPtr            *pFWClientLockCompleteProc);
  2240.  
  2241. OSStatus    FWSetFWClientInitIsochPortProc (
  2242.     FWReferenceID                fwReferenceID,
  2243.     FWClientInitIsochPortProcPtr
  2244.                                 fwClientInitIsochPortProc);
  2245.  
  2246. OSStatus    FWGetFWClientInitIsochPortProc (
  2247.     FWReferenceID                fwReferenceID,
  2248.     FWClientInitIsochPortProcPtr
  2249.                                 *pFWClientInitIsochPortProc);
  2250.  
  2251. OSStatus    FWSetFWClientReleaseIsochPortProc (
  2252.     FWReferenceID                fwReferenceID,
  2253.     FWClientReleaseIsochPortProcPtr
  2254.                                 fwClientReleaseIsochPortProc);
  2255.  
  2256. OSStatus    FWGetFWClientReleaseIsochPortProc (
  2257.     FWReferenceID                fwReferenceID,
  2258.     FWClientReleaseIsochPortProcPtr
  2259.                                 *pFWClientReleaseIsochPortProc);
  2260.  
  2261. OSStatus    FWSetFWClientStartIsochPortProc (
  2262.     FWReferenceID                fwReferenceID,
  2263.     FWClientStartIsochPortProcPtr
  2264.                                 fwClientStartIsochPortProc);
  2265.  
  2266. OSStatus    FWGetFWClientStartIsochPortProc (
  2267.     FWReferenceID                fwReferenceID,
  2268.     FWClientStartIsochPortProcPtr
  2269.                                 *pFWClientStartIsochPortProc);
  2270.  
  2271. OSStatus    FWSetFWClientStopIsochPortProc (
  2272.     FWReferenceID                fwReferenceID,
  2273.     FWClientStopIsochPortProcPtr
  2274.                                 fwClientStopIsochPortProc);
  2275.  
  2276. OSStatus    FWGetFWClientStopIsochPortProc (
  2277.     FWReferenceID                fwReferenceID,
  2278.     FWClientStopIsochPortProcPtr
  2279.                                 *pFWClientStopIsochPortProc);
  2280.  
  2281. TaskID    FWCurrentTaskID (void);
  2282.  
  2283. OSStatus    FWCreateSoftwareInterrupt (
  2284.     SoftwareInterruptHandler    theHandler,
  2285.     TaskID                        theTask,
  2286.     void                        *theParameter,
  2287.     Boolean                        persistent,
  2288.     SoftwareInterruptID            *theSoftwareInterrupt);
  2289.  
  2290. OSStatus    FWSendSoftwareInterrupt (
  2291.     SoftwareInterruptID            theSoftwareInterrupt,
  2292.     void                        *theParameter);
  2293.  
  2294. OSStatus    FWDeleteSoftwareInterrupt (
  2295.     SoftwareInterruptID            theSoftwareInterrupt);
  2296.  
  2297. OSStatus    FWAllocateFWCommandObject (
  2298.     FWCommandObjectID            *pFWCommandObjectID);
  2299.  
  2300. OSStatus    FWGetFWCommandObjectType (
  2301.     FWCommandObjectID            fwCommandObjectID,
  2302.     UInt32                        *pFWCommandObjectType);
  2303.  
  2304. OSStatus    FWGetFWCommandType (
  2305.     FWCommandObjectID            fwCommandObjectID,
  2306.     UInt32                        *pCommandType);
  2307.  
  2308. OSStatus    FWSetFWCommandFWReferenceID (
  2309.     FWCommandObjectID            fwCommandObjectID,
  2310.     FWReferenceID                fwReferenceID);
  2311.  
  2312. OSStatus    FWGetFWCommandFWReferenceID (
  2313.     FWCommandObjectID            fwCommandObjectID,
  2314.     FWReferenceID                *pFWReferenceID);
  2315.  
  2316. OSStatus    FWSetFWCommandFlags (
  2317.     FWCommandObjectID            fwCommandObjectID,
  2318.     UInt32                        commandFlags);
  2319.  
  2320. OSStatus    FWGetFWCommandFlags (
  2321.     FWCommandObjectID            fwCommandObjectID,
  2322.     UInt32                        *pCommandFlags);
  2323.  
  2324. OSStatus    FWGetFWCommandStatus (
  2325.     FWCommandObjectID            fwCommandObjectID,
  2326.     OSStatus                    *pCommandStatus);
  2327.  
  2328. OSStatus    FWSetFWCommandCompletionProc (
  2329.     FWCommandObjectID            fwCommandObjectID,
  2330.     FWCommandCompletionProcPtr    completionProc);
  2331.  
  2332. OSStatus    FWGetFWCommandCompletionProc (
  2333.     FWCommandObjectID            fwCommandObjectID,
  2334.     FWCommandCompletionProcPtr    *pCompletionProc);
  2335.  
  2336. OSStatus    FWSetFWCommandCompletionProcData (
  2337.     FWCommandObjectID            fwCommandObjectID,
  2338.     UInt32                        completionProcData);
  2339.  
  2340. OSStatus    FWGetFWCommandCompletionProcData (
  2341.     FWCommandObjectID            fwCommandObjectID,
  2342.     UInt32                        *pCompletionProcData);
  2343.  
  2344. OSStatus    FWSetFWCommandParams (
  2345.     FWCommandObjectID            fwCommandObjectID,
  2346.     FWReferenceID                fwReferenceID,
  2347.     UInt32                        commandFlags,
  2348.     FWCommandCompletionProcPtr    completionProc,
  2349.     UInt32                        completionProcData);
  2350.  
  2351. OSStatus    FWGetFWCommandParams (
  2352.     FWCommandObjectID            fwCommandObjectID,
  2353.     UInt32                        *pFWCommandObjectType,
  2354.     UInt32                        *pCommandType,
  2355.     FWReferenceID                *pFWReferenceID,
  2356.     UInt32                        *pCommandFlags,
  2357.     OSStatus                    *pCommandStatus,
  2358.     FWCommandCompletionProcPtr    *pCompletionProc,
  2359.     UInt32                        *pCompletionProcData);
  2360.  
  2361. OSStatus    FWDeallocateFWCommandObject (
  2362.     FWCommandObjectID            fwCommandObjectID);
  2363.  
  2364. OSStatus    FWGetTopologyMap (
  2365.     FWReferenceID                fwReferenceID,
  2366.     FWTopologyMapPtr            pFWTopologyMap);
  2367.  
  2368. OSStatus    FWAllocateAsynchCommandObject (
  2369.     FWCommandObjectID            *pFWCommandObjectID);
  2370.  
  2371. OSStatus    FWSetAsynchCommandGeneration (
  2372.     FWCommandObjectID            fwCommandObjectID,
  2373.     UInt32                        generation);
  2374.  
  2375. OSStatus    FWGetAsynchCommandGeneration (
  2376.     FWCommandObjectID            fwCommandObjectID,
  2377.     UInt32                        *pGeneration);
  2378.  
  2379. OSStatus    FWSetAsynchCommandAddress (
  2380.     FWCommandObjectID            fwCommandObjectID,
  2381.     UInt32                        addressHi,
  2382.     UInt32                        addressLo);
  2383.  
  2384. OSStatus    FWGetAsynchCommandAddress (
  2385.     FWCommandObjectID            fwCommandObjectID,
  2386.     UInt32                        *pAddressHi,
  2387.     UInt32                        *pAddressLo);
  2388.  
  2389. OSStatus    FWSetAsynchCommandBuffer (
  2390.     FWCommandObjectID            fwCommandObjectID,
  2391.     Ptr                            buffer);
  2392.  
  2393. OSStatus    FWGetAsynchCommandBuffer (
  2394.     FWCommandObjectID            fwCommandObjectID,
  2395.     Ptr                            *pBuffer);
  2396.  
  2397. OSStatus    FWSetAsynchCommandLength (
  2398.     FWCommandObjectID            fwCommandObjectID,
  2399.     UInt32                        length);
  2400.  
  2401. OSStatus    FWGetAsynchCommandLength (
  2402.     FWCommandObjectID            fwCommandObjectID,
  2403.     UInt32                        *pLength);
  2404.  
  2405. OSStatus    FWSetAsynchCommandBytesTransferred (
  2406.     FWCommandObjectID            fwCommandObjectID,
  2407.     UInt32                        bytesTransferred);
  2408.  
  2409. OSStatus    FWGetAsynchCommandBytesTransferred (
  2410.     FWCommandObjectID            fwCommandObjectID,
  2411.     UInt32                        *pBytesTransferred);
  2412.  
  2413. OSStatus    FWSetAsynchCommandMaxPayloadSize (
  2414.     FWCommandObjectID            fwCommandObjectID,
  2415.     UInt32                        maxPayloadSize);
  2416.  
  2417. OSStatus    FWGetAsynchCommandMaxPayloadSize (
  2418.     FWCommandObjectID            fwCommandObjectID,
  2419.     UInt32                        *pMaxPayloadSize);
  2420.  
  2421. OSStatus    FWSetAsynchCommandMaxRetries (
  2422.     FWCommandObjectID            fwCommandObjectID,
  2423.     UInt32                        maxRetries);
  2424.  
  2425. OSStatus    FWGetAsynchCommandMaxRetries (
  2426.     FWCommandObjectID            fwCommandObjectID,
  2427.     UInt32                        *pMaxRetries);
  2428.  
  2429. OSStatus    FWSetAsynchCommandTransferFlags (
  2430.     FWCommandObjectID            fwCommandObjectID,
  2431.     UInt32                        transferFlags);
  2432.  
  2433. OSStatus    FWGetAsynchCommandTransferFlags (
  2434.     FWCommandObjectID            fwCommandObjectID,
  2435.     UInt32                        *pTransferFlags);
  2436.  
  2437. OSStatus    FWSetAsynchCommandParams (
  2438.     FWCommandObjectID            fwCommandObjectID,
  2439.     UInt32                        generation,
  2440.     UInt32                        addressHi,
  2441.     UInt32                        addressLo,
  2442.     Ptr                            buffer,
  2443.     UInt32                        length,
  2444.     UInt32                        maxPayloadSize,
  2445.     UInt32                        maxRetries,
  2446.     UInt32                        transferFlags);
  2447.  
  2448. OSStatus    FWGetAsynchCommandParams (
  2449.     FWCommandObjectID            fwCommandObjectID,
  2450.     UInt32                        *pGeneration,
  2451.     UInt32                        *pAddressHi,
  2452.     UInt32                        *pAddressLo,
  2453.     Ptr                            *pBuffer,
  2454.     UInt32                        *pLength,
  2455.     UInt32                        *pBytesTransferred,
  2456.     UInt32                        *pMaxPayloadSize,
  2457.     UInt32                        *pMaxRetries,
  2458.     UInt32                        *pTransferFlags);
  2459.  
  2460. OSStatus    FWSetCommonAsynchCommandParams (
  2461.     FWCommandObjectID            fwCommandObjectID,
  2462.     UInt32                        addressHi,
  2463.     UInt32                        addressLo,
  2464.     Ptr                            buffer,
  2465.     UInt32                        length);
  2466.  
  2467. OSStatus    FWGetCommonAsynchCommandParams (
  2468.     FWCommandObjectID            fwCommandObjectID,
  2469.     Ptr                            *pBuffer,
  2470.     UInt32                        *pLength,
  2471.     UInt32                        *pBytesTransferred);
  2472.  
  2473. OSStatus    FWRead (
  2474.     FWCommandObjectID            fwCommandObjectID);
  2475.  
  2476. OSStatus    FWWrite (
  2477.     FWCommandObjectID            fwCommandObjectID);
  2478.  
  2479. OSStatus    FWCompareAndSwap (
  2480.     FWCommandObjectID            fwCommandObjectID);
  2481.  
  2482. OSStatus    FWBitAnd (
  2483.     FWCommandObjectID            fwCommandObjectID);
  2484.  
  2485. OSStatus    FWBitOr (
  2486.     FWCommandObjectID            fwCommandObjectID);
  2487.  
  2488. OSStatus    FWBitXor (
  2489.     FWCommandObjectID            fwCommandObjectID);
  2490.  
  2491. OSStatus    FWIncrement (
  2492.     FWCommandObjectID            fwCommandObjectID);
  2493.  
  2494. OSStatus    FWDecrement (
  2495.     FWCommandObjectID            fwCommandObjectID);
  2496.  
  2497. OSStatus    FWAdd (
  2498.     FWCommandObjectID            fwCommandObjectID);
  2499.  
  2500. OSStatus    FWThresholdAdd (
  2501.     FWCommandObjectID            fwCommandObjectID);
  2502.  
  2503. OSStatus    FWThresholdSubtract (
  2504.     FWCommandObjectID            fwCommandObjectID);
  2505.  
  2506. OSStatus    FWClippedAdd (
  2507.     FWCommandObjectID            fwCommandObjectID);
  2508.  
  2509. OSStatus    FWClippedSubtract (
  2510.     FWCommandObjectID            fwCommandObjectID);
  2511.  
  2512. OSStatus    FWSendFCPCommand (
  2513.     FWCommandObjectID            fwCommandObjectID);
  2514.  
  2515. OSStatus    FWAllocateFCPCommandObject (
  2516.     FWCommandObjectID            *pFWCommandObjectID);
  2517.  
  2518. OSStatus    FWSetFCPCommandCommandBuffer (
  2519.     FWCommandObjectID            fwCommandObjectID,
  2520.     Ptr                            commandBuffer);
  2521.  
  2522. OSStatus    FWGetFCPCommandCommandBuffer (
  2523.     FWCommandObjectID            fwCommandObjectID,
  2524.     Ptr                            *pCommandBuffer);
  2525.  
  2526. OSStatus    FWSetFCPCommandCommandLength (
  2527.     FWCommandObjectID            fwCommandObjectID,
  2528.     UInt32                        commandLength);
  2529.  
  2530. OSStatus    FWGetFCPCommandCommandLength (
  2531.     FWCommandObjectID            fwCommandObjectID,
  2532.     UInt32                        *pCommandLength);
  2533.  
  2534. OSStatus    FWSetFCPCommandResponseBuffer (
  2535.     FWCommandObjectID            fwCommandObjectID,
  2536.     Ptr                            responseBuffer);
  2537.  
  2538. OSStatus    FWGetFCPCommandResponseBuffer (
  2539.     FWCommandObjectID            fwCommandObjectID,
  2540.     Ptr                            *pResponseBuffer);
  2541.  
  2542. OSStatus    FWSetFCPCommandResponseBufferSize (
  2543.     FWCommandObjectID            fwCommandObjectID,
  2544.     UInt32                        responseBufferSize);
  2545.  
  2546. OSStatus    FWGetFCPCommandResponseBufferSize (
  2547.     FWCommandObjectID            fwCommandObjectID,
  2548.     UInt32                        *pResponseBufferSize);
  2549.  
  2550. OSStatus    FWSetFCPCommandResponseLength (
  2551.     FWCommandObjectID            fwCommandObjectID,
  2552.     UInt32                        responseLength);
  2553.  
  2554. OSStatus    FWGetFCPCommandResponseLength (
  2555.     FWCommandObjectID            fwCommandObjectID,
  2556.     UInt32                        *pResponseLength);
  2557.  
  2558. OSStatus    FWSetFCPCommandTimeout (
  2559.     FWCommandObjectID            fwCommandObjectID,
  2560.     Duration                    timeout);
  2561.  
  2562. OSStatus    FWGetFCPCommandTimeout (
  2563.     FWCommandObjectID            fwCommandObjectID,
  2564.     Duration                    *pTimeout);
  2565.  
  2566. OSStatus    FWSetFCPCommandMaxRetries (
  2567.     FWCommandObjectID            fwCommandObjectID,
  2568.     UInt32                        maxRetries);
  2569.  
  2570. OSStatus    FWGetFCPCommandMaxRetries (
  2571.     FWCommandObjectID            fwCommandObjectID,
  2572.     UInt32                        *pMaxRetries);
  2573.  
  2574. OSStatus    FWSetFCPCommandTransferFlags (
  2575.     FWCommandObjectID            fwCommandObjectID,
  2576.     UInt32                        transferFlags);
  2577.  
  2578. OSStatus    FWGetFCPCommandTransferFlags (
  2579.     FWCommandObjectID            fwCommandObjectID,
  2580.     UInt32                        *pTransferFlags);
  2581.  
  2582. OSStatus    FWSetFCPCommandResponseHandler (
  2583.     FWCommandObjectID            fwCommandObjectID,
  2584.     FCPResponseHandlerPtr        fcpResponseHandler);
  2585.  
  2586. OSStatus    FWGetFCPCommandResponseHandler (
  2587.     FWCommandObjectID            fwCommandObjectID,
  2588.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2589.  
  2590. OSStatus    FWSetFCPCommandParams (
  2591.     FWCommandObjectID            fwCommandObjectID,
  2592.     Ptr                            commandBuffer,
  2593.     UInt32                        commandLength,
  2594.     Ptr                            responseBuffer,
  2595.     UInt32                        responseBufferSize,
  2596.     Duration                    timeout,
  2597.     UInt32                        maxRetries,
  2598.     UInt32                        transferFlags,
  2599.     FCPResponseHandlerPtr        fcpResponseHandler);
  2600.  
  2601. OSStatus    FWGetFCPCommandParams (
  2602.     FWCommandObjectID            fwCommandObjectID,
  2603.     Ptr                            *pCommandBuffer,
  2604.     UInt32                        *pCommandLength,
  2605.     Ptr                            *pResponseBuffer,
  2606.     UInt32                        *pResponseBufferSize,
  2607.     UInt32                        *pResponseLength,
  2608.     Duration                    *pTimeout,
  2609.     UInt32                        *pMaxRetries,
  2610.     UInt32                        *pTransferFlags,
  2611.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2612.  
  2613. OSStatus    FWResetBus (
  2614.     FWCommandObjectID            fwCommandObjectID);
  2615.  
  2616. OSStatus    FWAllocateIsochronousChannelID (
  2617.     IsochChannelID                *pIsochChannelID,
  2618.     Boolean                        doIRMAllocation,
  2619.     UInt32                        bandwidth,
  2620.     UInt32                        preferredSpeed);
  2621.  
  2622. OSStatus    FWDeallocateIsochronousChannelID (
  2623.     IsochChannelID                isochChannelID);
  2624.  
  2625. OSStatus    FWAddIsochronousChannelClient (
  2626.     IsochChannelID                isochChannelID,
  2627.     FWReferenceID                fwReferenceID,
  2628.     UInt32                        refCon,
  2629.     Boolean                        clientIsTalker);
  2630.  
  2631. OSStatus    FWSetIsochChannelForceStopNotificationProc (
  2632.     IsochChannelID                isochChannelID,
  2633.     FWIsochChannelForceStopNotificationProcPtr
  2634.                                 fwIsochChannelForceStopNotificationProc);
  2635.  
  2636. OSStatus    FWInitializeIsochronousChannel (
  2637.     FWCommandObjectID            fwCommandObjectID);
  2638.  
  2639. OSStatus    FWReleaseIsochronousChannel (
  2640.     FWCommandObjectID            fwCommandObjectID);
  2641.  
  2642. OSStatus    FWStartIsochronousChannel (
  2643.     FWCommandObjectID            fwCommandObjectID);
  2644.  
  2645. OSStatus    FWStopIsochronousChannel (
  2646.     FWCommandObjectID            fwCommandObjectID);
  2647.  
  2648. OSStatus    FWAllocateIsochChannelCommandObject (
  2649.     FWCommandObjectID            *pFWCommandObjectID);
  2650.  
  2651. OSStatus    FWSetIsochChannelCommandIsochChannelID (
  2652.     FWCommandObjectID            fwCommandObjectID,
  2653.     IsochChannelID                isochChannelID);
  2654.  
  2655. OSStatus    FWGetIsochChannelCommandIsochChannelID (
  2656.     FWCommandObjectID            fwCommandObjectID,
  2657.     IsochChannelID                *pIsochChannelID);
  2658.  
  2659. OSStatus    FWCreateDCLProgram (
  2660.     DCLProgramID                *pDCLProgramID);
  2661.  
  2662. OSStatus    FWDisposeDCLProgram (
  2663.     DCLProgramID                dclProgramID);
  2664.  
  2665. OSStatus    FWSetDCLProgramStart (
  2666.     DCLProgramID                dclProgramID,
  2667.     DCLCommandPtr                pDCLStart);
  2668.  
  2669. OSStatus    FWGetDCLProgramStart (
  2670.     DCLProgramID                dclProgramID,
  2671.     DCLCommandPtr                *ppDCLStart);
  2672.  
  2673. OSStatus    FWSetDCLProgramEngineData (
  2674.     DCLProgramID                dclProgramID,
  2675.     UInt32                        dclEngineData);
  2676.  
  2677. OSStatus    FWGetDCLProgramEngineData (
  2678.     DCLProgramID                dclProgramID,
  2679.     UInt32                        *pDCLEngineData);
  2680.  
  2681. OSStatus    FWSetDCLProgramStartProc (
  2682.     DCLProgramID                dclProgramID,
  2683.     DCLProgramStartProcPtr        dclProgramStartProc);
  2684.  
  2685. OSStatus    FWGetDCLProgramStartProc (
  2686.     DCLProgramID                dclProgramID,
  2687.     DCLProgramStartProcPtr        *pDCLProgramStartProc);
  2688.  
  2689. OSStatus    FWSetDCLProgramStopProc (
  2690.     DCLProgramID                dclProgramID,
  2691.     DCLProgramStopProcPtr        dclProgramStopProc);
  2692.  
  2693. OSStatus    FWGetDCLProgramStopProc (
  2694.     DCLProgramID                dclProgramID,
  2695.     DCLProgramStopProcPtr        *pDCLProgramStopProc);
  2696.  
  2697. OSStatus    FWSetDCLProgramReleaseProc (
  2698.     DCLProgramID                dclProgramID,
  2699.     DCLProgramReleaseProcPtr    dclProgramReleaseProc);
  2700.  
  2701. OSStatus    FWGetDCLProgramReleaseProc (
  2702.     DCLProgramID                dclProgramID,
  2703.     DCLProgramReleaseProcPtr    *pDCLProgramReleaseProc);
  2704.  
  2705. OSStatus    FWSetDCLProgramCompilerNotificationProc (
  2706.     DCLProgramID                dclProgramID,
  2707.     DCLCompilerNotificationProcPtr
  2708.                                 dclCompilerNotificationProc);
  2709.  
  2710. OSStatus    FWGetDCLProgramCompilerNotificationProc (
  2711.     DCLProgramID                dclProgramID,
  2712.     DCLCompilerNotificationProcPtr
  2713.                                 *pDCLCompilerNotificationProc);
  2714.  
  2715. OSStatus    FWSetDCLProgramChannelNum (
  2716.     DCLProgramID                dclProgramID,
  2717.     UInt32                        channelNum);
  2718.  
  2719. OSStatus    FWGetDCLProgramChannelNum (
  2720.     DCLProgramID                dclProgramID,
  2721.     UInt32                        *pChannelNum);
  2722.  
  2723. OSStatus    FWSetDCLProgramTalking (
  2724.     DCLProgramID                dclProgramID,
  2725.     Boolean                        talking);
  2726.  
  2727. OSStatus    FWGetDCLProgramTalking (
  2728.     DCLProgramID                dclProgramID,
  2729.     Boolean                        *pTalking);
  2730.  
  2731. OSStatus    FWSetDCLProgramStartEvent (
  2732.     DCLProgramID                dclProgramID,
  2733.     UInt32                        startEvent,
  2734.     UInt32                        startEventState,
  2735.     UInt32                        startEventStateMask);
  2736.  
  2737. OSStatus    FWGetDCLProgramStartEvent (
  2738.     DCLProgramID                dclProgramID,
  2739.     UInt32                        *pStartEvent,
  2740.     UInt32                        *pStartEventState,
  2741.     UInt32                        *pStartEventStateMask);
  2742.  
  2743. OSStatus    FWTranslateDCLProgram (
  2744.     DCLProgramID                dclProgramID,
  2745.     DCLProgramID                *pTranslatedDCLProgramID);
  2746.  
  2747. OSStatus    FWStartDCLProgram (
  2748.     DCLProgramID                dclProgramID);
  2749.  
  2750. OSStatus    FWStopDCLProgram (
  2751.     DCLProgramID                dclProgramID);
  2752.  
  2753. OSStatus    FWReleaseDCLProgram (
  2754.     DCLProgramID                dclProgramID);
  2755.  
  2756. OSStatus    FWUpdateDCLList (
  2757.     DCLProgramID                dclProgramID,
  2758.     DCLCommandPtr                *dclCommandList,
  2759.     UInt32                        numDCLCommands);
  2760.  
  2761. OSStatus    FWModifyDCLList (
  2762.     DCLProgramID                dclProgramID,
  2763.     DCLCommandPtr                *dclCommandList,
  2764.     UInt32                        numDCLCommands);
  2765.  
  2766. OSStatus    FWModifyDCLJump (
  2767.     DCLProgramID                dclProgramID,
  2768.     DCLJumpPtr                    pDCLJump,
  2769.     DCLLabelPtr                    pDCLLabel);
  2770.  
  2771. OSStatus    FWCallDCLCallProc (
  2772.     DCLProgramID                dclProgramID,
  2773.     DCLCallProcPtr                pDCLCallProc);
  2774.  
  2775. OSStatus    FWAllocateIsochPortID (
  2776.     IsochPortID                    *pIsochPortID,
  2777.     DCLProgramID                dclProgramID,
  2778.     UInt32                        channelNum,
  2779.     UInt32                        speed,
  2780.     Boolean                        talking);
  2781.  
  2782. OSStatus    FWDeallocateIsochPortID (
  2783.     IsochPortID                    isochPortID);
  2784.  
  2785. OSStatus    FWAllocateLocalIsochronousPort (
  2786.     FWCommandObjectID            fwCommandObjectID);
  2787.  
  2788. OSStatus    FWReleaseLocalIsochronousPort (
  2789.     FWCommandObjectID            fwCommandObjectID);
  2790.  
  2791. OSStatus    FWStartLocalIsochronousPort (
  2792.     FWCommandObjectID            fwCommandObjectID);
  2793.  
  2794. OSStatus    FWStopLocalIsochronousPort (
  2795.     FWCommandObjectID            fwCommandObjectID);
  2796.  
  2797. OSStatus    FWContinueLocalIsochronousPort (
  2798.     FWCommandObjectID            fwCommandObjectID);
  2799.  
  2800. OSStatus    FWAllocateIsochPortCommandObject (
  2801.     FWCommandObjectID            *pFWCommandObjectID);
  2802.  
  2803. OSStatus    FWSetIsochPortCommandIsochPortID (
  2804.     FWCommandObjectID            fwCommandObjectID,
  2805.     IsochPortID                    isochPortID);
  2806.  
  2807. OSStatus    FWGetIsochPortCommandIsochPortID (
  2808.     FWCommandObjectID            fwCommandObjectID,
  2809.     IsochPortID                    *pIsochPortID);
  2810.  
  2811. OSStatus    FWCSRROMGetRootDirectory (
  2812.     FWReferenceID                fwReferenceID,
  2813.     CSRROMEntryID                *pCSRROMEntryID);
  2814.  
  2815. OSStatus    FWCSRROMGetEntryAddress (
  2816.     CSRROMEntryID                csrROMEntryID,
  2817.     UInt32                        *pAddress);
  2818.  
  2819. OSStatus    FWCSRROMGetEntryDataAddress (
  2820.     CSRROMEntryID                csrROMEntryID,
  2821.     UInt32                        *pAddress);
  2822.  
  2823. OSStatus    FWCSRROMCreateEntry (
  2824.     CSRROMEntryID                parentCSRROMEntryID,
  2825.     CSRROMEntryID                *pCSRROMEntryID,
  2826.     UInt32                        entryType,
  2827.     UInt32                        entryKeyValue,
  2828.     void                        *entryData,
  2829.     UInt32                        entrySize);
  2830.  
  2831. OSStatus    FWCSRROMDisposeEntry (
  2832.     CSRROMEntryID                csrROMEntryID);
  2833.  
  2834. OSStatus    FWCSRROMInstantiate (
  2835.     FWReferenceID                fwReferenceID);
  2836.  
  2837. OSStatus FWCSRROMCreateIterator (
  2838.     CSRROMEntryIterator            *pCSRROMIterator,
  2839.     FWReferenceID                fwReferenceID);
  2840.  
  2841. void FWCSRROMDisposeIterator (
  2842.     CSRROMEntryIterator            csrROMIterator);
  2843.  
  2844. OSStatus    FWCSRROMSetIterator (
  2845.     CSRROMEntryIterator            csrROMIterator,
  2846.     CSRROMEntryID                csrROMEntryID,
  2847.     CSRROMIterationOp            relationship);
  2848.  
  2849. OSStatus    FWCSRROMEntrySearch (
  2850.     CSRROMEntryIterator            csrROMIterator,
  2851.     CSRROMIterationOp            relationship,
  2852.     CSRROMEntryID                *pEntryID,
  2853.     Boolean                        *pDone,
  2854.     CSRROMSearchCriteriaPtr        pSearchCriteria,
  2855.     Ptr                            pEntryValue,
  2856.     UInt32                        *pEntrySize);
  2857.  
  2858. CSRROMEntryID    FWCSRROMCreateEntryID (void);
  2859.  
  2860. void  FWCSRROMDisposeEntryID (
  2861.     CSRROMEntryID                csrROMEntryID);
  2862.  
  2863. OSStatus    FWCSRROMCopyEntryID (
  2864.     CSRROMEntryID                srcCSRROMEntryID,
  2865.     CSRROMEntryID                *pDstCSRROMEntryID);
  2866.  
  2867. OSStatus    FWCSRROMCompareEntryIDs (
  2868.     CSRROMEntryID                csrROMEntryID1,
  2869.     CSRROMEntryID                csrROMEntryID2,
  2870.     Boolean                        *pCSRROMEntryIDsEqual);
  2871.  
  2872. void  FWCSRROMInvalidateEntryIDType (
  2873.     CSRROMEntryID                csrROMEntryID);
  2874.  
  2875. OSStatus    FWAllocateAddressSpace (
  2876.     FWAddressSpaceID            *pFWAddressSpaceID,
  2877.     FWReferenceID                fwReferenceID,
  2878.     FWAddressPtr                pFWAddress,
  2879.     UInt32                        size,
  2880.     Ptr                            addressBuffer,
  2881.     UInt32                        addressFlags,
  2882.     Ptr                            pAddressSpecificData);
  2883.  
  2884. OSStatus    FWDeallocateAddressSpace (
  2885.     FWAddressSpaceID            fwAddressSpaceID);
  2886.  
  2887. OSStatus    FWProcessReadRequest (
  2888.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  2889.  
  2890. OSStatus    FWProcessWriteRequest (
  2891.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  2892.  
  2893. OSStatus    FWProcessLockRequest (
  2894.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  2895.  
  2896. OSStatus    FWGetLocalFWReferenceIDFromFWReferenceID (
  2897.     FWReferenceID                fwReferenceID,
  2898.     FWReferenceID                *pLocalFWReferenceID);
  2899.  
  2900. OSStatus    FWGetFWDeviceIDFromFWReferenceID (
  2901.     FWReferenceID                fwReferenceID,
  2902.     FWDeviceID                    *pFWDeviceID);
  2903.  
  2904. OSStatus    FWFindFWDeviceFromNodeID (
  2905.     FWReferenceID                fwReferenceID,
  2906.     UInt32                        generation,
  2907.     UInt32                        nodeID,
  2908.     FWDeviceID                    *pFWDeviceID);
  2909.  
  2910. OSStatus    FWGetNodeID (
  2911.     FWReferenceID                fwReferenceID,
  2912.     UInt32                        *pNodeID,
  2913.     UInt32                        *pGenerationNumber);
  2914.  
  2915. OSStatus    FWGetUniqueID (
  2916.     FWReferenceID                fwReferenceID,
  2917.     CSRNodeUniqueIDPtr            pUniqueID);
  2918.  
  2919. OSStatus    FWGetUnitCSRROMEntryID (
  2920.     FWReferenceID                fwReferenceID,
  2921.     CSRROMEntryID                *pUnitCSRROMEntryID);
  2922.  
  2923. OSStatus    FWGetFWIsochResourceManagerID (
  2924.     FWReferenceID                fwReferenceID,
  2925.     FWIsochResourceManagerID    *pFWIsochResourceManagerID);
  2926.  
  2927. OSStatus    FWSetMaxPayloadSize (
  2928.     FWReferenceID                fwReferenceID,
  2929.     UInt32                        maxPayloadSize);
  2930.  
  2931. OSStatus    FWClientCommandIsComplete (
  2932.     FWClientCommandID            fwClientCommandID,
  2933.     OSStatus                    commandStatus);
  2934.  
  2935. OSStatus    FWIMCommandIsComplete (
  2936.     FWIMCommandID                fwimCommandID,
  2937.     OSStatus                    commandStatus);
  2938.  
  2939. OSStatus    FWProcessBusReset (
  2940.     FWIMID                        fwimID);
  2941.  
  2942. void    FWProcessSelfIDs (
  2943.     FWIMProcessSelfIDsParamsPtr    pFWIMProcessSelfIDsParams);
  2944.  
  2945. OSStatus    FWCreateDeferredTask (
  2946.     FWDeferredTaskID            *pFWDeferredTaskID,
  2947.     FWDeferredTaskProcPtr        fwDeferredTaskProc,
  2948.     void                        *param1);
  2949.  
  2950. OSStatus    FWDisposeDeferredTask (
  2951.     FWDeferredTaskID            fwDeferredTaskID);
  2952.  
  2953. OSStatus    FWScheduleDeferredTask (
  2954.     FWDeferredTaskID            fwDeferredTaskID,
  2955.     void                        *param2);
  2956.  
  2957.  
  2958. //zzz Put in Devices.h
  2959.  
  2960. /* Categories */
  2961.  
  2962. enum {
  2963.     kServiceCategoryFWIM        = 'fwim',                        /* FireWire interface module */
  2964.     kServiceCategoryFWDriver    = 'fwdv'                        /* FireWire device driver */
  2965. };
  2966.  
  2967. // End - Put in Devices.h
  2968.  
  2969. //zzz Put in Errors.h
  2970.  
  2971. enum {
  2972.     inUseErr                    = -4160,                // Item already in use
  2973.     notFoundErr                    = -4161,                // Item not found
  2974.     timeoutErr                    = -4162,                // Something timed out
  2975.     busReconfiguredErr            = -4163,                // Bus was reconfigured
  2976.     insufficientBandwidthErr    = -4164,                // Not enough bandwidth was available
  2977.     invalidIDErr                = -4165,                // Given ID is not valid.
  2978.     invalidIDTypeErr            = -4166,                // Given ID is of an invalid type for the requested operation.
  2979.     accessErr                    = -4167,                // Requested access not allowed.
  2980.     alreadyRegisteredErr        = -4168,                // Item has already been registered.
  2981.     disconnectedErr                = -4169,                // Target of request has been disconnected.
  2982.     retryExceededErr            = -4170,                // Retry limit was exceeded.
  2983.     addressRangeErr                = -4171,                // Address is not in range.
  2984.     addressAlignmentErr            = -4172,                // Address is not of proper alignment.
  2985.  
  2986.     multipleTalkerErr            = -4180,                // Tried to install multiple talkers
  2987.     channelActiveErr            = -4181,                // Operation not permitted when channel is active
  2988.     noListenerOrTalkerErr        = -4182,                // Every isochronous channel must have one talker and at least
  2989.                                                         // one listener
  2990.     noChannelsAvailableErr        = -4183,                // No supported isochronous channels are available
  2991.     channelNotAvailableErr        = -4184,                // Required channel was not available.
  2992.     invalidIsochPortIDErr        = -4185,                // An isochronous port ID is invalid.
  2993.     invalidFWReferenceTypeErr    = -4186,                // Operation does not support type of given reference ID
  2994.     separateBusErr                = -4187,                // Two or more entities are on two or more busses and cannot be associated with eachother.
  2995.     badSelfIDsErr                = -4188                    // Received self IDs are bad.
  2996. };
  2997.  
  2998. // end - Put in Errors.h
  2999.  
  3000. #if PRAGMA_ALIGN_SUPPORTED
  3001. #pragma options align=reset
  3002. #endif
  3003.  
  3004. #if PRAGMA_IMPORT_SUPPORTED
  3005. #pragma import off
  3006. #endif
  3007.  
  3008. #ifdef __cplusplus
  3009. }
  3010. #endif
  3011.  
  3012. #endif /* __FIREWIRE__ */
  3013.